- geopandas.read_parquet(path, columns=None, storage_options=None, **kwargs)¶
Load a Parquet object from the file path, returning a GeoDataFrame.
You can read a subset of columns in the file using the
columnsparameter. However, the structure of the returned GeoDataFrame will depend on which columns you read:
if no geometry columns are read, this will raise a
ValueError- you should use the pandas read_parquet method instead.
if the primary geometry column saved to this file is not included in columns, the first available geometry column will be set as the geometry column of the returned GeoDataFrame.
Supports versions 0.1.0, 0.4.0 of the GeoParquet specification at: https://github.com/opengeospatial/geoparquet
If ‘crs’ key is not present in the GeoParquet metadata associated with the Parquet object, it will default to “OGC:CRS84” according to the specification.
New in version 0.8.
- pathstr, path object
- columnslist-like of strings, default=None
If not None, only these columns will be read from the file. If the primary geometry column is not included, the first secondary geometry read from the file will be set as the geometry column of the returned GeoDataFrame. If no geometry columns are present, a
ValueErrorwill be raised.
- storage_optionsdict, optional
Extra options that make sense for a particular storage connection, e.g. host, port, username, password, etc. For HTTP(S) URLs the key-value pairs are forwarded to urllib as header options. For other URLs (e.g. starting with “s3://”, and “gcs://”) the key-value pairs are forwarded to fsspec. Please see fsspec and urllib for more details.
When no storage options are provided and a filesystem is implemented by both
fsspec(e.g. “s3://”) then the
pyarrow.fsfilesystem is preferred. Provide the instantiated fsspec filesystem using the
filesystemkeyword if you wish to use its implementation.
Any additional kwargs passed to pyarrow.parquet.read_table().
>>> df = geopandas.read_parquet("data.parquet")
Specifying columns to read:
>>> df = geopandas.read_parquet( ... "data.parquet", ... columns=["geometry", "pop_est"] ... )