Skip to content

Array

geoarrow.rust.core.GeoArray

null_count property

null_count: int

The number of null values in the array.

type property

type: GeoType

The type of the array.

__arrow_c_array__

__arrow_c_array__(
    requested_schema: object | None = None,
) -> tuple[object, object]

An implementation of the Arrow PyCapsule Interface. This dunder method should not be called directly, but enables zero-copy data transfer to other Python libraries that understand Arrow memory.

For example, you can call pyarrow.array() to convert this array into a pyarrow array, without copying memory.

__eq__

__eq__(value: object) -> bool

__getitem__

__getitem__(item: int) -> GeoScalar

__len__

__len__() -> int

__repr__

__repr__() -> str

cast

cast(to_type: GeoType) -> GeoArray

Cast to another GeoType.

Criteria:
  • Dimension must be compatible:
    • If the source array and destination type are both dimension-aware, then their dimensions must match.
    • Casts from dimension-aware to dimensionless arrays (GeometryArray, WkbArray, WkbViewArray, WktArray, WktViewArray) are always allowed.
  • GeoArrow metadata (i.e. CRS and edges) on the source and destination types must match.
Infallible casts:

As long as the above criteria are met, these casts will always succeed without erroring.

  • The same geometry type with different coord types.
  • Any source array type to Geometry, Wkb, LargeWkb, WkbView, Wkt, LargeWkt, or WktView.
  • Point to MultiPoint
  • LineString to MultiLineString
  • Polygon to MultiPolygon
Fallible casts:
  • Geometry to any other native type.
  • Parsing WKB or WKT to any native type other than Geometry.
  • MultiPoint to Point
  • MultiLineString to LineString
  • MultiPolygon to Polygon

downcast

downcast(*, coord_type: CoordTypeInput = SEPARATED) -> GeoArray

Downcast to its simplest, most-compact native geometry representation.

If there is no simpler representation, the array is returned unchanged.

from_arrow classmethod

from_arrow(data: ArrowArrayExportable) -> GeoArray

Import an array from an Arrow array object.

This uses the Arrow PyCapsule interface to import the array, so any producer that implements the protocol is supported.

The existing array must have associated GeoArrow metadata.

from_arrow_pycapsule classmethod

from_arrow_pycapsule(schema_capsule: object, array_capsule: object) -> GeoArray