Exemplo 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)
Exemplo n.º 2
0
Arquivo: layer.py Projeto: 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
Exemplo 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
Exemplo 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
Exemplo n.º 5
0
 def clone(self):
     "Returns a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr))
Exemplo n.º 6
0
 def clone(self):
     "Returns a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr))
Exemplo n.º 7
0
"""
Exemplo n.º 8
0
Arquivo: srs.py Projeto: ZekriSara/pfe
 def clone(self):
     "Return a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr), axis_order=self.axis_order)
Exemplo 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
Exemplo n.º 10
0
from ctypes import byref, c_double