GeoArrow Pandas provides GeoArrow extension types for pandas DataFrames, enabling efficient storage and manipulation of geospatial data using the Apache Arrow memory format. It integrates with pandas by implementing the ExtensionArray and ExtensionDtype protocols. The current version is 0.1.1, and it is considered an experimental library with a relatively slow release cadence, indicating ongoing development.
pip install geoarrow-pandasVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a pandas Series using GeoArrow extension types, specifically the Well-Known Binary (WKB) format. It uses `shapely` to construct geometries and `ga.wkb_type()` to specify the GeoArrow dtype. The series will behave like a regular pandas Series but with GeoArrow's efficient backing.
Always review release notes for new versions. Pin specific minor versions in your dependencies to mitigate unexpected changes for a period.
For operations primarily within the GeoArrow ecosystem, try to avoid frequent conversions to GeoPandas. Convert only when specific GeoPandas functionality is required. Consider processing data in chunks or streaming if memory becomes an issue.
To access these methods, you may need to explicitly convert the GeoArrow Series to a `geopandas.GeoSeries` using `ga.to_geopandas()` (if the input is a DataFrame/Series) or access the underlying GeoArrowArray for lower-level operations. Many spatial operations can also be performed via the `geoarrow` library itself.
Ensure that the input data (e.g., list of shapely objects) is compatible with the chosen GeoArrow type (e.g., `ga.wkb_type()`). If working with PyArrow arrays directly, ensure they conform to the GeoArrow specifications.
Ensure your input data is a list of `shapely` geometries, WKB/WKT strings, or a compatible PyArrow array. Explicitly specify the GeoArrow dtype, e.g., `pd.Series([...], dtype=ga.wkb_type())` or `pd.Series([...], dtype=ga.point_type(pyarrow.float64()))`.
GeoArrow Pandas provides a memory-efficient backbone, but does not replicate all GeoPandas geometry methods directly. Convert your data to a `geopandas.GeoDataFrame` or `GeoSeries` first using `ga.to_geopandas()` if you need these methods, or use lower-level functions from the `geoarrow` library itself for spatial operations.
Install the library using pip: `pip install geoarrow-pandas`.