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 or Path-like,) – path to geometry file

  • driver ({'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, or dict) – Source coordinate reference system, ignored for files with a native crs.

  • dst_crs (str, pyproj.CRS, or dict) – Destination coordinate reference system.

  • bbox (array of float, default None) – Filter features by given bounding box described by [xmin, ymin, xmax, ymax] Cannot be used with mask.

  • geom (GeoDataFrame or GeoSeries | shapely Geometry, default None) – 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 type

  • predicate ({'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:

geopandas.GeoDataFrame