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.
fields Return the names of the fields.

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.
close Close the GeomSouce.
copy_layer Copy a layer to an existing dataset.
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