onstove.VectorLayer.read_layer#
- VectorLayer.read_layer(path: str, conn: sqlalchemy.engine.Connection | None = None, bbox: GeoDataFrame | None = None, query: str | None = None)[source]#
Reads a dataset from GIS vector data file.
It works as a wrapper method that will use either the geopandas.read_file function or the geopandas.read_postgis function to read vector data and store the output in the
data
attribute and the layer path in thepath
attribute.- Parameters:
- path: str, optional
The relative path to the datafile. This file can be of any type that is accepted by geopandas.read_file.
- conn: sqlalchemy.engine.Connection or sqlalchemy.engine.Engine, optional
PostgreSQL connection if the layer needs to be read from a database. This accepts any connection type used by geopandas.read_postgis.
- bbox: tuple, GeoDataFrame, GeoSeries or shapely Geometry, optional
Filter features by a given bounding box, GeoSeries, GeoDataFrame or a shapely geometry. For more information refer to geopandas.read_file.
- query: str, optional
A query string to filter the data. For more information refer to pandas.DataFrame.query.