Exemple #1
0
def flatten_data_sources(data_sources):
    """Iterates through data_sources, ensuring all geometries are 2D, for loading into PostGIS"""
    for data_source in data_sources:
        for layer in data_source:
            for feature in layer:
                geom_ptr = capi.get_feat_geom_ref(feature.ptr)
                if coordinate_dimension(geom_ptr) > 2:
                    flatten_to_2d(geom_ptr)
Exemple #2
0
 def geom(self):
     "Return the OGR Geometry for this Feature."
     # Retrieving the geometry pointer for the feature.
     geom_ptr = capi.get_feat_geom_ref(self.ptr)
     return OGRGeometry(geom_api.clone_geom(geom_ptr))
Exemple #3
0
 def geom(self):
     "Return the OGR Geometry for this Feature."
     # Retrieving the geometry pointer for the feature.
     geom_ptr = capi.get_feat_geom_ref(self.ptr)
     return OGRGeometry(geom_api.clone_geom(geom_ptr))
from django.contrib.gis.gdal.base import GDALBase
Exemple #5
0
=======
        "Return a list of fields in the Feature."
        return [
            force_text(
                capi.get_field_name(capi.get_field_defn(self._layer._ldefn, i)),
                self.encoding,
                strings_only=True
            ) for i in range(self.num_fields)
        ]

    @property
    def geom(self):
        "Return the OGR Geometry for this Feature."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        # Retrieving the geometry pointer for the feature.
        geom_ptr = capi.get_feat_geom_ref(self.ptr)
        return OGRGeometry(geom_api.clone_geom(geom_ptr))

    @property
    def geom_type(self):
<<<<<<< HEAD
        "Returns the OGR Geometry Type for this Feture."
=======
        "Return the OGR Geometry Type for this Feture."
>>>>>>> 37c99181c9a6b95433d60f8c8ef9af5731096435
        return OGRGeomType(capi.get_fd_geom_type(self._layer._ldefn))

    # #### Feature Methods ####
    def get(self, field):
        """
<<<<<<< HEAD