Skip to content

Interoperability

Interoperability with other in-memory Python

geoarrow.rust.core

from_ewkb builtin

from_ewkb(input: ArrowArrayExportable) -> PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray

Parse an Arrow BinaryArray from EWKB to its GeoArrow-native counterpart.

Parameters:

Returns:

from_geopandas builtin

from_geopandas(input: gpd.GeoDataFrame) -> GeoTable

Create a GeoArrow Table from a GeoPandas GeoDataFrame.

Notes:
  • Currently this will always generate a non-chunked GeoArrow array. This is partly because pyarrow.Table.from_pandas always creates a single batch.
  • This requires pyarrow version 14 or later.

Parameters:

Returns:

from_shapely builtin

from_shapely(input) -> PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray

Create a GeoArrow array from an array of Shapely geometries.

Notes:
  • Currently this will always generate a non-chunked GeoArrow array. Use the from_shapely method on a chunked GeoArrow array class to construct a chunked array.
  • This will first call to_ragged_array, falling back to to_wkb if necessary. If you know you have mixed-type geometries in your column, use MixedGeometryArray.from_shapely.

This is because to_ragged_array is the fastest approach but fails on mixed-type geometries. It supports combining Multi-* geometries with non-multi-geometries in the same array, so you can combine e.g. Point and MultiPoint geometries in the same array, but to_ragged_array doesn't work if you have Point and Polygon geometries in the same array.

Args:

input: Any array object accepted by Shapely, including numpy object arrays and geopandas.GeoSeries.

Returns:

A GeoArrow array

from_wkb builtin

from_wkb(input: ArrowArrayExportable) -> PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray

Parse an Arrow BinaryArray from WKB to its GeoArrow-native counterpart.

This expects ISO-formatted WKB geometries.

Parameters:

Returns:

from_wkt builtin

from_wkt(input: ArrowArrayExportable) -> PointArray | LineStringArray | PolygonArray | MultiPointArray | MultiLineStringArray | MultiPolygonArray | MixedGeometryArray | GeometryCollectionArray

Parse an Arrow StringArray from WKT to its GeoArrow-native counterpart.

Parameters:

Returns:

to_geopandas builtin

to_geopandas(input: ArrowStreamExportable) -> gpd.GeoDataFrame

Convert a GeoArrow Table to a GeoPandas GeoDataFrame.

Notes:
  • This requires [pyarrow][pyarrow] version 14 or later.

Parameters:

Returns:

to_shapely builtin

to_shapely(input: ArrowArrayExportable) -> NDArray[np.object_]

Convert a GeoArrow array to a numpy array of Shapely objects

Parameters:

Returns:

to_wkb builtin

to_wkb(input: ArrowArrayExportable) -> WKBArray

Encode a GeoArrow-native geometry array to a WKBArray, holding ISO-formatted WKB geometries.

Parameters:

Returns:

  • WKBArray

    An array with WKB-formatted geometries