def __getitem__(self, index): "Gets the Geometry at the specified index." if index < 0 or index >= self.geom_count: raise OGRIndexError('index out of range: %s' % index) else: return OGRGeometry( capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs)
def __getitem__(self, index): "Get the ring at the specified index." if 0 <= index < self.geom_count: return OGRGeometry( capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs) else: raise IndexError( "Index out of range when accessing rings of a polygon: %s." % index)
def __getitem__(self, index): "Get the Geometry at the specified index." if 0 <= index < self.geom_count: return OGRGeometry( capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs) else: raise IndexError( 'Index out of range when accessing geometry in a collection: %s.' % index)
def _get_spatial_filter(self): try: return OGRGeometry(geom_api.clone_geom(capi.get_spatial_filter(self.ptr))) except GDALException: return None
def geom(self): "Return the OGR Geometry for this Feature." # Retrieving the geometry pointer for the feature. geom_ptr = capi.get_feat_geom_ref(self.ptr) return OGRGeometry(geom_api.clone_geom(geom_ptr))
def _get_spatial_filter(self): try: return OGRGeometry( geom_api.clone_geom(capi.get_spatial_filter(self.ptr))) except OGRException: return None
def __getitem__(self, index): "Gets the Geometry at the specified index." if index < 0 or index >= self.geom_count: raise OGRIndexError('index out of range: %s' % index) else: return OGRGeometry(capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs)
def clone(self): "Clones this OGR Geometry." return OGRGeometry(capi.clone_geom(self.ptr), self.srs)
def __getitem__(self, index): "Get the Geometry at the specified index." if 0 <= index < self.geom_count: return OGRGeometry(capi.clone_geom(capi.get_geom_ref(self.ptr, index)), self.srs) else: raise IndexError('Index out of range when accessing geometry in a collection: %s.' % index)
from django.contrib.gis.gdal.base import GDALBase
"Return the EWKT representation of the Geometry." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 srs = self.srs if srs and srs.srid: return 'SRID=%s;%s' % (srs.srid, self.wkt) else: return self.wkt # #### Geometry Methods #### def clone(self): <<<<<<< HEAD "Clones this OGR Geometry." ======= "Clone this OGR Geometry." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 return OGRGeometry(capi.clone_geom(self.ptr), self.srs) def close_rings(self): """ If there are any rings within this geometry that have not been closed, this routine will do so by adding the starting point at the end. """ # Closing the open rings. capi.geom_close_rings(self.ptr) def transform(self, coord_trans, clone=False): """ <<<<<<< HEAD Transforms this geometry to a different spatial reference system. May take a CoordTransform object, a SpatialReference object, string
"Return a list of fields in the Feature." return [ force_text( capi.get_field_name(capi.get_field_defn(self._layer._ldefn, i)), self.encoding, strings_only=True ) for i in range(self.num_fields) ] @property def geom(self): "Return the OGR Geometry for this Feature." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 # Retrieving the geometry pointer for the feature. geom_ptr = capi.get_feat_geom_ref(self.ptr) return OGRGeometry(geom_api.clone_geom(geom_ptr)) @property def geom_type(self): <<<<<<< HEAD "Returns the OGR Geometry Type for this Feture." ======= "Return the OGR Geometry Type for this Feture." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn)) # #### Feature Methods #### def get(self, field): """ <<<<<<< HEAD Returns the value of the field, instead of an instance of the Field
from ctypes import byref, c_double