geopandas.GeoDataFrame.to_parquet#
- GeoDataFrame.to_parquet(path, index=None, compression='snappy', schema_version=None, **kwargs)[source]#
Write a GeoDataFrame to the Parquet format.
Any geometry columns present are serialized to WKB format in the file.
Requires ‘pyarrow’.
WARNING: this is an early implementation of Parquet file support and associated metadata, the specification for which continues to evolve. This is tracking version 0.4.0 of the GeoParquet specification at: opengeospatial/geoparquet
This metadata specification does not yet make stability promises. As such, we do not yet recommend using this in a production setting unless you are able to rewrite your Parquet files.
New in version 0.8.
- Parameters:
- pathstr, path object
- indexbool, default None
If
True
, always include the dataframe’s index(es) as columns in the file output. IfFalse
, the index(es) will not be written to the file. IfNone
, the index(ex) will be included as columns in the file output except RangeIndex which is stored as metadata only.- compression{‘snappy’, ‘gzip’, ‘brotli’, None}, default ‘snappy’
Name of the compression to use. Use
None
for no compression.- schema_version{‘0.1.0’, ‘0.4.0’, None}
GeoParquet specification version; if not provided will default to latest supported version.
- kwargs
Additional keyword arguments passed to
pyarrow.parquet.write_table()
.
See also
GeoDataFrame.to_feather
write GeoDataFrame to feather
GeoDataFrame.to_file
write GeoDataFrame to file
Examples
>>> gdf.to_parquet('data.parquet')