Esempio n. 1
0
 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)
Esempio n. 2
0
File: layer.py Progetto: 01-/django
 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
Esempio n. 3
0
 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
Esempio n. 4
0
 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
Esempio n. 5
0
 def clone(self):
     "Returns a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr))
Esempio n. 6
0
 def clone(self):
     "Returns a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr))
Esempio n. 7
0
"""
Esempio n. 8
0
File: srs.py Progetto: ZekriSara/pfe
 def clone(self):
     "Return a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr), axis_order=self.axis_order)
Esempio n. 9
0
        "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
Esempio n. 10
0
from ctypes import byref, c_double