wradlib.io.gdal.VectorSource

Contents

wradlib.io.gdal.VectorSource#

class wradlib.io.gdal.VectorSource(data=None, trg_crs=None, name='layer', source=0, **kwargs)[source]#

DataSource class for handling ogr/gdal vector data

DataSource handles creates in-memory (vector) ogr DataSource object with one layer for point or polygon geometries.

Parameters:
Keyword Arguments:
  • name (str) – Layer Name, defaults to “layer”.

  • source (int) – Number of layer to load, if multiple layers in source shape file.

  • mode (str) – Return type of class access functions/properties. Can be either of “numpy”, “geo” and “ogr”, defaults to “numpy”.

  • src_crs

    Coordinate Reference System (CRS) of the coordinates. Can be one of:

    CRS in which source data is provided in.

Warning

Writing shapefiles with the wrong locale settings can have impact on the type of the decimal. If problem arise use LC_NUMERIC=C in your environment.

Examples

See Vector Source.

close()

dump_raster(filename, *[, driver, attr, ...])

Output layer to GDAL Rasterfile

dump_vector(filename, *[, driver, remove])

Output layer to OGR Vector File

get_attributes(attrs, *[, filt])

Return attributes

get_attrs_and_props(*[, attrs, props, filt])

Return properties and attributes

get_data_by_att([attr, value, mode])

Returns DataSource geometries filtered by given attribute/value

get_data_by_geom([geom, mode])

Returns DataSource geometries filtered by given geometry

get_data_by_idx(idx, *[, mode])

Returns DataSource geometries from given index

get_geom_properties(props, *[, filt])

Return geometry properties

load_vector(filename, *[, source, driver])

Read Layer from OGR Vector File

set_attribute(name, values, *[, reset_filter])

Add/Set given Attribute with given values

crs

data

Returns VectorSource geometries as numpy arrays

ds

Returns VectorSource

extent

geo

Returns VectorSource geometries as GeoPandas Dataframe

mode