gis.gdal.Layer.get_geoms()

get_geoms(geos=False) A method that returns a list containing the geometry of each feature in the layer. If the optional argument geos is set to True then the geometries are converted to GEOSGeometry objects. Otherwise, they are returned as OGRGeometry objects: >>> [pt.tuple for pt in layer.get_geoms()] [(-104.609252, 38.255001), (-95.23506, 38.971823), (-95.363151, 29.763374)]

gis.gdal.Layer.get_fields()

get_fields() A method that returns a list of the values of a given field for each feature in the layer: >>> layer.get_fields('Name') ['Pueblo', 'Lawrence', 'Houston']

gis.gdal.Layer.geom_type

geom_type Returns the geometry type of the layer, as an OGRGeomType object: >>> layer.geom_type.name 'Point'

gis.gdal.Layer.field_widths

field_widths Returns a list of the maximum field widths for each of the fields in this layer: >>> layer.field_widths [80, 11, 24, 10]

gis.gdal.Layer.field_precisions

field_precisions Returns a list of the numeric precisions for each of the fields in this layer. This is meaningless (and set to zero) for non-numeric fields: >>> layer.field_precisions [0, 0, 15, 0]

gis.gdal.Layer.fields

fields Returns a list of the names of each of the fields in this layer: >>> layer.fields ['Name', 'Population', 'Density', 'Created'] Returns a list of the data types of each of the fields in this layer. These are subclasses of Field, discussed below: >>> [ft.__name__ for ft in layer.field_types] ['OFTString', 'OFTReal', 'OFTReal', 'OFTDate']

gis.gdal.Layer.extent

extent Returns the spatial extent of this layer, as an Envelope object: >>> layer.extent.tuple (-104.609252, 29.763374, -95.23506, 38.971823)

gis.gdal.Layer

class Layer Layer is a wrapper for a layer of data in a DataSource object. You never create a Layer object directly. Instead, you retrieve them from a DataSource object, which is essentially a standard Python container of Layer objects. For example, you can access a specific layer by its index (e.g. ds[0] to access the first layer), or you can iterate over all the layers in the container in a for loop. The Layer itself acts as a container for geometric features. Typically, all the features i

gis.gdal.GeometryCollection.add()

add(geom) Adds a geometry to this geometry collection. Not applicable to other geometry types.

gis.gdal.GeometryCollection

class GeometryCollection add(geom) Adds a geometry to this geometry collection. Not applicable to other geometry types.