GeomSource

io.GeomSource(self, file, mode='r', overwrite=False)

A source object for geospatial vector data.

Essentially an OGR DataSource wrapper.

Parameters

Name Type Description Default
file str Path to a file. required
mode str The I/O mode. Either r for reading or w for writing. 'r'
overwrite bool Whether or not to overwrite an existing dataset. False

Examples

Index the GeomSource directly to get features.

# Load a file
gm = GeomSource(< path-to-file >)

# Index it!
feature = gm[1]

Attributes

Name Description
bounds Return the bounds of the GridSource.
columns Return the columns header of the attribute tabel.
dtypes summary.
fields Return the names of the fields.
geom_type Return the geometry type.

Methods

Name Description
add_feature Add a feature to the layer.
add_feature_from_defn Add a feature to a layer by using properties from another.
add_feature_with_map Add a feature with extra field data.
close Close the GeomSouce.
copy_layer Copy a layer to an existing dataset.
create Create a data source.
create_field Add a new field.
create_fields Add multiple fields at once.
create_layer Create a new vector layer.
create_layer_from_copy Create a new layer by copying another layer.
flush Flush the data.
get_srs Return the srs (Spatial Reference System).
Back to top