hydromt.data_adapter.GeoDataFrameAdapter#
- class hydromt.data_adapter.GeoDataFrameAdapter(path, driver=None, crs=None, nodata=None, rename={}, unit_mult={}, unit_add={}, units={}, meta={}, **kwargs)[source]#
Initiates data adapter for geospatial vector data.
This object contains all properties required to read supported files into a single unified
geopandas.GeoDataFrame()
. In addition it keeps meta data to be able to reproduce which data is used.- Parameters:
path (str, Path) – Path to data source.
driver ({'vector', 'vector_table'}, optional) – Driver to read files with, for ‘vector’
read_file()
, for {‘vector_table’}hydromt.io.open_vector_from_table()
By default the driver is inferred from the file extension and falls back to ‘vector’ if unknown.crs (int, dict, or str, optional) – Coordinate Reference System. Accepts EPSG codes (int or str); proj (str or dict) or wkt (str). Only used if the data has no native CRS.
nodata ((dictionary) float, int, optional) – Missing value number. Only used if the data has no native missing value. Multiple nodata values can be provided in a list and differentiated between dataframe columns using a dictionary with variable (column) keys. The nodata values are only applied to columns with numeric data.
rename (dict, optional) – Mapping of native data source variable to output source variable name as required by hydroMT.
unit_mult (dict, optional) – Scaling multiplication and addition to change to map from the native data unit to the output data unit as required by hydroMT.
unit_add (dict, optional) – Scaling multiplication and addition to change to map from the native data unit to the output data unit as required by hydroMT.
meta (dict, optional) – Metadata information of dataset, prefably containing the following keys: {‘source_version’, ‘source_url’, ‘source_license’, ‘paper_ref’, ‘paper_doi’, ‘category’}
**kwargs – Additional key-word arguments passed to the driver.
- __init__(path, driver=None, crs=None, nodata=None, rename={}, unit_mult={}, unit_add={}, units={}, meta={}, **kwargs)[source]#
Initiates data adapter for geospatial vector data.
This object contains all properties required to read supported files into a single unified
geopandas.GeoDataFrame()
. In addition it keeps meta data to be able to reproduce which data is used.- Parameters:
path (str, Path) – Path to data source.
driver ({'vector', 'vector_table'}, optional) – Driver to read files with, for ‘vector’
read_file()
, for {‘vector_table’}hydromt.io.open_vector_from_table()
By default the driver is inferred from the file extension and falls back to ‘vector’ if unknown.crs (int, dict, or str, optional) – Coordinate Reference System. Accepts EPSG codes (int or str); proj (str or dict) or wkt (str). Only used if the data has no native CRS.
nodata ((dictionary) float, int, optional) – Missing value number. Only used if the data has no native missing value. Multiple nodata values can be provided in a list and differentiated between dataframe columns using a dictionary with variable (column) keys. The nodata values are only applied to columns with numeric data.
rename (dict, optional) – Mapping of native data source variable to output source variable name as required by hydroMT.
unit_mult (dict, optional) – Scaling multiplication and addition to change to map from the native data unit to the output data unit as required by hydroMT.
unit_add (dict, optional) – Scaling multiplication and addition to change to map from the native data unit to the output data unit as required by hydroMT.
meta (dict, optional) – Metadata information of dataset, prefably containing the following keys: {‘source_version’, ‘source_url’, ‘source_license’, ‘paper_ref’, ‘paper_doi’, ‘category’}
**kwargs – Additional key-word arguments passed to the driver.
Methods
__init__
(path[, driver, crs, nodata, ...])Initiates data adapter for geospatial vector data.
get_data
([bbox, geom, predicate, buffer, ...])Returns a clipped and unified GeoDataFrame (vector) based on the properties of this GeoDataFrameAdapter.
resolve_paths
([time_tuple, variables])Resolve {year}, {month} and {variable} keywords in self.path based on 'time_tuple' and 'variables' arguments
summary
()Returns a dictionary summary of the data adapter.
to_dict
()Returns a dictionary view of the data source.
to_file
(data_root, data_name[, bbox, ...])Save a data slice to file.
Attributes
data_type