def _set_srs(self, srs): "Sets the SpatialReference for this geometry." if isinstance(srs, SpatialReference): srs_ptr = srs_api.clone_srs(srs.ptr) elif isinstance(srs, (int, long, basestring)): sr = SpatialReference(srs) srs_ptr = srs_api.clone_srs(sr.ptr) else: raise TypeError('Cannot assign spatial reference with object of type: %s' % type(srs)) capi.assign_srs(self.ptr, srs_ptr)
def srs(self): "Returns the Spatial Reference used in this Layer." try: ptr = capi.get_layer_srs(self.ptr) return SpatialReference(srs_api.clone_srs(ptr)) except SRSException: return None
def _get_srs(self): "Returns the Spatial Reference for this Geometry." try: srs_ptr = capi.get_geom_srs(self.ptr) return SpatialReference(srs_api.clone_srs(srs_ptr)) except SRSException: return None
def clone(self): "Returns a clone of this SpatialReference object." return SpatialReference(capi.clone_srs(self.ptr))
"""
def clone(self): "Return a clone of this SpatialReference object." return SpatialReference(capi.clone_srs(self.ptr), axis_order=self.axis_order)
"Return the envelope as a 4-tuple, instead of as an Envelope object." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 return self.envelope.tuple # #### SpatialReference-related Properties #### # The SRS property def _get_srs(self): <<<<<<< HEAD "Returns the Spatial Reference for this Geometry." ======= "Return the Spatial Reference for this Geometry." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 try: srs_ptr = capi.get_geom_srs(self.ptr) return SpatialReference(srs_api.clone_srs(srs_ptr)) except SRSException: return None def _set_srs(self, srs): <<<<<<< HEAD "Sets the SpatialReference for this geometry." ======= "Set the SpatialReference for this geometry." >>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435 # Do not have to clone the `SpatialReference` object pointer because # when it is assigned to this `OGRGeometry` it's internal OGR # reference count is incremented, and will likewise be released # (decremented) when this geometry's destructor is called. if isinstance(srs, SpatialReference): srs_ptr = srs.ptr
from ctypes import byref, c_double