{"id":9008,"library":"geoarrow-pyarrow","title":"GeoArrow PyArrow","description":"GeoArrow PyArrow is a Python library that enables working with GeoArrow data using PyArrow's efficient C++ bindings. It provides tools to serialize and deserialize geospatial data (like points, lines, polygons) into the GeoArrow format, leveraging Apache Arrow for high-performance, columnar data processing. As of version 0.2.0, it focuses on core GeoArrow type implementation and interoperability with Shapely and PyArrow. The release cadence is driven by GeoArrow specification updates and core development.","status":"active","version":"0.2.0","language":"en","source_language":"en","source_url":"https://github.com/geoarrow/geoarrow-python","tags":["geospatial","arrow","pyarrow","data-structures","interoperability","gis"],"install":[{"cmd":"pip install geoarrow-pyarrow","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core dependency for Arrow data structures and C++ bindings.","package":"pyarrow","optional":false},{"reason":"Used for conversion to and from common Python geospatial objects.","package":"shapely","optional":false},{"reason":"Optional dependency for certain array operations or input types.","package":"numpy","optional":true},{"reason":"Optional dependency for DataFrame integration.","package":"pandas","optional":true},{"reason":"Optional dependency for more advanced geospatial data handling.","package":"geopandas","optional":true}],"imports":[{"note":"The primary module for GeoArrow PyArrow functionality.","wrong":"from geoarrow import pyarrow as ga","symbol":"geoarrow.pyarrow","correct":"import geoarrow.pyarrow as ga"},{"note":"For accessing specific GeoArrow type constructors and definitions.","symbol":"geoarrow.pyarrow.types","correct":"import geoarrow.pyarrow.types as gat"}],"quickstart":{"code":"import geoarrow.pyarrow as ga\nimport shapely.geometry\nimport pyarrow as pa\n\n# Create some Shapely Point geometries\npoints = [\n    shapely.geometry.Point(1, 2),\n    shapely.geometry.Point(3, 4),\n    shapely.geometry.Point(5, 6)\n]\n\n# Convert Shapely geometries to a GeoArrow array using the unified constructor\ngeoarrow_array = ga.array(points)\n\nprint(\"GeoArrow Array Type:\", geoarrow_array.type)\nprint(\"GeoArrow Array:\", geoarrow_array)\n\n# You can also convert it back to Shapely objects\nshapely_roundtrip = geoarrow_array.to_shapely()\nprint(\"Shapely Roundtrip:\", shapely_roundtrip)\n\n# Integrate GeoArrow arrays into a PyArrow Table\ntable = pa.table({'id': [1, 2, 3], 'geometry': geoarrow_array})\nprint(\"\\nPyArrow Table:\")\nprint(table)\n\n# It's crucial to register extension types when loading data from disk\n# if the data contains GeoArrow types.\n# ga.register_extension_types() # Uncomment if loading from file\n","lang":"python","description":"This quickstart demonstrates how to create a GeoArrow array from a list of Shapely geometries, inspect its type and contents, convert it back to Shapely, and integrate it into a PyArrow Table. It highlights the use of the `ga.array()` constructor for data conversion."},"warnings":[{"fix":"Update your code to use the new unified `geoarrow.pyarrow.array()` constructor for most conversions from Python objects (Shapely, WKB, lists of coordinates). For advanced construction, refer to `geoarrow.pyarrow.construct`.","message":"The GeoArrow PyArrow API underwent significant changes in version 0.2.0. Functions like `from_shapely`, `from_wkb`, and direct module-level constructors were replaced or consolidated.","severity":"breaking","affected_versions":"from 0.1.x to 0.2.0"},{"fix":"Manage CRS information explicitly in your application layer (e.g., using `geopandas` or other geospatial libraries). Ensure consistent CRS when combining or processing GeoArrow data.","message":"GeoArrow itself is a data format for geometries and does not embed Coordinate Reference System (CRS) information. This is similar to how PyArrow handles non-semantic types.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Call `geoarrow.pyarrow.register_extension_types()` at the start of your script or before any read operations that might contain GeoArrow data.","message":"When loading data from files (e.g., Parquet, Feather) that contain GeoArrow extension types, you must register these types *before* reading the file. Otherwise, PyArrow will not recognize them and might load them as generic binary or list types.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your environment has `pyarrow` version 10.0 or higher. You can upgrade with `pip install --upgrade pyarrow`.","message":"GeoArrow PyArrow has a strict dependency on `pyarrow >= 10.0`. Using an older version of PyArrow will likely result in `ImportError` or runtime crashes due to ABI incompatibilities.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the package using pip: `pip install geoarrow-pyarrow`","cause":"The `geoarrow-pyarrow` package is not installed or not available in the current Python environment.","error":"ModuleNotFoundError: No module named 'geoarrow'"},{"fix":"Update your code to use the new unified `geoarrow.pyarrow.array()` constructor. For example, `ga.array(shapely_geometries)` or `ga.array(wkb_bytes_list)`.","cause":"Attempting to use the `0.1.x` API (e.g., direct `from_shapely` or `from_wkb` functions) with `geoarrow-pyarrow` version `0.2.0` or newer.","error":"ImportError: cannot import name 'from_shapely' from 'geoarrow.pyarrow' (...)"},{"fix":"Call `geoarrow.pyarrow.register_extension_types()` at the beginning of your script, before any file read operations that might involve GeoArrow data.","cause":"Attempting to read a file (e.g., Parquet, Feather) containing GeoArrow extension types without registering them first in the current Python session.","error":"pyarrow.lib.ArrowInvalid: Could not find GeoArrow extension type for geoarrow.point.xy (or similar for other types)"},{"fix":"Upgrade `pyarrow` to version 10.0 or higher: `pip install --upgrade pyarrow`","cause":"The installed `pyarrow` version is older than the minimum required by `geoarrow-pyarrow`.","error":"ImportError: geoarrow.pyarrow requires pyarrow >= 10.0.0, but you have 9.0.0 (or similar version mismatch)"}]}