示例#1
0
文件: geometries.py 项目: gimo/django
 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)
示例#2
0
文件: layer.py 项目: 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
示例#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
示例#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
示例#5
0
文件: srs.py 项目: JMassapina/lettuce
 def clone(self):
     "Returns a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr))
示例#6
0
 def clone(self):
     "Returns a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr))
示例#7
0
"""
示例#8
0
文件: srs.py 项目: ZekriSara/pfe
 def clone(self):
     "Return a clone of this SpatialReference object."
     return SpatialReference(capi.clone_srs(self.ptr), axis_order=self.axis_order)
示例#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
示例#10
0
from ctypes import byref, c_double