Пример #1
0
 def extent(self):
     "Returns the extent (an Envelope) of this layer."
     env = OGREnvelope()
     capi.get_extent(self.ptr, byref(env), 1)
     return Envelope(env)
Пример #2
0
<<<<<<< HEAD
        "Returns the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise."
=======
        "Return the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        return capi.get_area(self.ptr)

    @property
    def envelope(self):
<<<<<<< HEAD
        "Returns the envelope for this Geometry."
=======
        "Return the envelope for this Geometry."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        # TODO: Fix Envelope() for Point geometries.
        return Envelope(capi.get_envelope(self.ptr, byref(OGREnvelope())))

    @property
    def empty(self):
        return capi.is_empty(self.ptr)

    @property
    def extent(self):
<<<<<<< HEAD
        "Returns the envelope as a 4-tuple, instead of as an Envelope object."
=======
        "Return the envelope as a 4-tuple, instead of as an Envelope object."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        return self.envelope.tuple

    # #### SpatialReference-related Properties ####
Пример #3
0
 def envelope(self):
     "Returns the envelope for this Geometry."
     # TODO: Fix Envelope() for Point geometries.
     return Envelope(capi.get_envelope(self.ptr, byref(OGREnvelope())))
Пример #4
0
        # Should have returned a Feature, raise an OGRIndexError.
        raise OGRIndexError('Invalid feature id: %s.' % feat_id)
=======
        # Should have returned a Feature, raise an IndexError.
        raise IndexError('Invalid feature id: %s.' % feat_id)
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435

    # #### Layer properties ####
    @property
    def extent(self):
<<<<<<< HEAD
        "Returns the extent (an Envelope) of this layer."
=======
        "Return the extent (an Envelope) of this layer."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        env = OGREnvelope()
        capi.get_extent(self.ptr, byref(env), 1)
        return Envelope(env)

    @property
    def name(self):
<<<<<<< HEAD
        "Returns the name of this layer in the Data Source."
=======
        "Return the name of this layer in the Data Source."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        name = capi.get_fd_name(self._ldefn)
        return force_text(name, self._ds.encoding, strings_only=True)

    @property
    def num_feat(self, force=1):