Registry / data / geoarrow-types

geoarrow-types

JSON →
library0.3.0pypypiunverified

The `geoarrow-types` package defines Python types for the GeoArrow specification, primarily as PyArrow extension types. It provides a foundational layer for representing geospatial data in Apache Arrow columnar format, enabling interoperability and high-performance geospatial data processing. The current version is 0.3.0, and it follows a minor release cadence aligned with the broader GeoArrow Python ecosystem.

pip install geoarrow-types
INSTALL
IMPORT
SIG · GEOARROW-TYPES
G
geoarrow-types
datapythonv0.3.0
Install
1.7s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.7s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PointExtensionType
from geoarrow.types import PointExtensionType
from geoarrow import PointExtensionType

This quickstart demonstrates how to register GeoArrow extension types and create PyArrow arrays using these types. It covers both a structured geometry type (Point) and a binary representation type (WKB). The `register_extension_type()` call is essential for PyArrow to map the string identifier (e.g., 'geoarrow.point') to the custom Python class.

import pyarrow as pa from geoarrow_types import PointExtensionType, WkbExtensionType # 1. Register GeoArrow Point Type # This step is crucial for PyArrow to recognize 'geoarrow.point' by name PointExtensionType.register_extension_type() # Create a PyArrow array using the registered GeoArrow point type point_data = pa.array( [ {'x': 1.0, 'y': 2.0}, {'x': 3.0, 'y': 4.0}, None # GeoArrow types support null values ], type="geoarrow.point" # Use the registered string name ) print("\nGeoArrow Point Array:") print(point_data) print("Is GeoArrow Point Type recognized:", isinstance(point_data.type, PointExtensionType)) # 2. Register GeoArrow WKB Type WkbExtensionType.register_extension_type() # Example WKB bytes (usually generated by libraries like shapely) wkb_point_bytes = b'\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0?\x00\x00\x00\x00\x00\x00\x00@' wkb_linestring_bytes = b'\x01\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08@\x00\x00\x00\x00\x00\x00\x10@\x00\x00\x00\x00\x00\x00\x14@\x00\x00\x00\x00\x00\x00\x18@' wkb_data = pa.array([wkb_point_bytes, wkb_linestring_bytes, None], type="geoarrow.wkb") print("\nGeoArrow WKB Array:") print(wkb_data) print("Is GeoArrow WKB Type recognized:", isinstance(wkb_data.type, WkbExtensionType))
Debug
Known issues
gotchaGeoArrow extension types must be explicitly registered with PyArrow before they can be used by their string identifier (e.g., 'geoarrow.point') when creating arrays. Forgetting this will lead to errors.
fix
Always call `YourExtensionType.register_extension_type()` before creating an array with `pa.array(..., type='geoarrow.yourtype')`.
affects: All versions
breakingVersion 0.3.0 explicitly requires `pyarrow>=10.0.0`. Older versions of PyArrow (e.g., 9.x or earlier) are not compatible and will likely cause installation or runtime issues.
fix
Ensure your environment has `pyarrow` installed at version 10.0.0 or higher. Upgrade with `pip install --upgrade pyarrow`.
affects: 0.3.0+
gotchaWhen manually constructing `pyarrow.ExtensionArray` from a storage array, the storage array's PyArrow data type must precisely match the `_storage_type` defined by the GeoArrow Extension Type. Mismatches will raise `pyarrow.lib.ArrowInvalid`.
fix
Consult the `_storage_type` property or documentation for the specific `GeoArrowExtensionType` to determine the expected underlying PyArrow data type (e.g., `pa.struct` for Point types, `pa.binary` for WKB).
affects: All versions
Upgrade
Version history
0.3.0latest on PyPI · released May 27, 2025
Audit
Dependencies
pyarrowrequiredCore dependency for defining and using Apache Arrow extension types.
Agent activity
21 hits · last 30 days
node
20
Bingbot
1
Resources
geoarrow-types — pip install geoarrow-types · libregistry