Skip to main content
Encode a GeoDataFrame to GeoArrow format. See https://geoarrow.org/ for details on the GeoArrow specification. This function returns a generic Arrow data object implementing the Arrow PyCapsule Protocol (i.e. having an __arrow_c_stream__ method). This object can then be consumed by your Arrow implementation of choice that supports this protocol. Requires GeoPandas 1.0.0 or later.

Signature

Parameters

bool | None
default:"None"
If True, always include the dataframe’s index(es) as columns in the output. If False, the index(es) will not be included. If None, the index(es) are included as columns. Unlike GeoPandas, this also applies to a RangeIndex, because Sedona always converts it into a general Index.
('WKB', 'geoarrow')
default:"'WKB'"
The GeoArrow encoding to use for the data conversion.
bool
default:"True"
Only relevant for ‘geoarrow’ encoding. If True, the geometries’ coordinates are interleaved in a single fixed size list array. If False, the coordinates are stored as separate arrays in a struct type.
bool | None
default:"None"
Only relevant for ‘geoarrow’ encoding (for WKB, the dimensionality of the individual geometries is preserved). If False, return 2D geometries. If True, include the third dimension in the output (if a geometry has no third dimension, the z-coordinates will be NaN). By default, will infer the dimensionality from the input geometries. Note that this inference can be unreliable with empty geometries (for a guaranteed result, it is recommended to specify the keyword).

Returns

ArrowTable
A generic Arrow table object with geometry columns encoded to GeoArrow.

Examples