hydromt.io.open_vector#
- hydromt.io.open_vector(path: str | Path, *, driver: Literal['csv', 'xls', 'xy', 'pyogrio', 'parquet', 'xlsx'] | None = None, crs: CRS | None = None, dst_crs: CRS | None = None, bbox: Tuple[float] | None = None, geom: GeoDataFrame | GeoSeries | None = None, assert_gtype: Point | LineString | Polygon | None = None, predicate: Literal['intersects', 'within', 'contains', 'overlaps', 'crosses', 'touches'] = 'intersects', **kwargs)[source]#
Open fiona-compatible geometry, csv, parquet, excel or xy file and parse it.
Construct a
geopandas.GeoDataFrame()
CSV, parquet, or XLS file are converted to point geometries based on default columns names for the x- and y-coordinates, or if given, the x_dim and y_dim arguments.- Parameters:
path (
str
orPath-like,
) – path to geometry filedriver (
{'csv', 'xls', 'xy', 'pyogrio', 'parquet'}
, optional) – driver used to read the file:geopandas.open_file()
for gdal vector files,hydromt.io.open_vector_from_table()
for csv, parquet, xls(x) and xy files. By default None, and inferred from file extension.crs (
str
, pyproj.CRS, ordict
) – Source coordinate reference system, ignored for files with a native crs.dst_crs (
str
, pyproj.CRS, ordict
) – Destination coordinate reference system.bbox (
array
offloat
, defaultNone
) – Filter features by given bounding box described by [xmin, ymin, xmax, ymax] Cannot be used with mask.geom (
GeoDataFrame
orGeoSeries | shapely Geometry
, defaultNone
) – Filter for features that intersect with the mask. CRS mis-matches are resolved if given a GeoSeries or GeoDataFrame. Cannot be used with bbox.assert_gtype (
{Point, LineString, Polygon}
, optional) – If given, assert geometry typepredicate (
{'intersects', 'within', 'contains', 'overlaps', 'crosses', 'touches'}
,
) – optional. If predicate is provided, the GeoDataFrame is filtered by testing the predicate function against each item. Requires bbox or mask. By default ‘intersects’**kwargs – Keyword args to be passed to the driver method when opening the file
- Returns:
gdf – Parsed geometry file
- Return type: