Skip to main content
Write the GeoDataFrame to a file.

Signature

Parameters

str
required
File path or file handle to write to.
str | None
default:"None"
The format driver used to write the file. If not specified, it attempts to infer it from the file extension. If no extension is specified, Sedona will error.Options: “geojson”, “geopackage”, “geoparquet”
dict | None
default:"None"
Not applicable to Sedona’s implementation.
bool | None
default:"None"
If True, write index into one or more columns (for MultiIndex). Default None writes the index into one or more columns only if the index is named, is a MultiIndex, or has a non-integer data type. If False, no index is written.
Additional keyword arguments:mode : str, default ‘w’ The write mode, ‘w’ to overwrite the existing file and ‘a’ to append. ‘overwrite’ and ‘append’ are equivalent to ‘w’ and ‘a’ respectively.crs : pyproj.CRS, default None If specified, the CRS is passed to Fiona to better control how the file is written. If None, GeoPandas will determine the CRS based on the crs attribute. The value can be anything accepted by pyproj.CRS.from_user_input <pyproj.crs.CRS.from_user_input>, such as an authority string (e.g., “EPSG:4326”) or a WKT string.engine : str Not applicable to Sedona’s implementation.metadata : dict[str, str], default None Optional metadata to be stored in the file. Keys and values must be strings. Supported only for “GPKG” driver. Not supported by Sedona.

Examples

With selected drivers you can also append to a file with mode="a":
When the index is of non-integer dtype, index=None (default) is treated as True, writing the index to the file.