def add(self, geom): "Add the geometry to this Geometry Collection." if isinstance(geom, OGRGeometry): if isinstance(geom, self.__class__): for g in geom: capi.add_geom(self.ptr, g.ptr) else: capi.add_geom(self.ptr, geom.ptr)
def add(self, geom): "Add the geometry to this Geometry Collection." if isinstance(geom, OGRGeometry): if isinstance(geom, self.__class__): for g in geom: capi.add_geom(self.ptr, g.ptr) else: capi.add_geom(self.ptr, geom.ptr) elif isinstance(geom, six.string_types): tmp = OGRGeometry(geom) capi.add_geom(self.ptr, tmp.ptr) else: raise OGRException('Must add an OGRGeometry.')
def add(self, geom): "Add the geometry to this Geometry Collection." if isinstance(geom, OGRGeometry): if isinstance(geom, self.__class__): for g in geom: capi.add_geom(self.ptr, g.ptr) else: capi.add_geom(self.ptr, geom.ptr) elif isinstance(geom, six.string_types): tmp = OGRGeometry(geom) capi.add_geom(self.ptr, tmp.ptr) else: raise OGRException('Must add an OGRGeometry.')
def add(self, geom): "Add the geometry to this Geometry Collection." if isinstance(geom, OGRGeometry): if isinstance(geom, self.__class__): for g in geom: capi.add_geom(self.ptr, g.ptr) else: capi.add_geom(self.ptr, geom.ptr) <<<<<<< HEAD elif isinstance(geom, six.string_types): ======= elif isinstance(geom, str): >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 tmp = OGRGeometry(geom) capi.add_geom(self.ptr, tmp.ptr) else: raise GDALException('Must add an OGRGeometry.') @property def point_count(self): <<<<<<< HEAD "The number of Points in this Geometry Collection." ======= "Return the number of Points in this Geometry Collection." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 # Summing up the number of points in each geometry in this collection return sum(self[i].point_count for i in range(self.geom_count)) @property def tuple(self):