Skip to content

Chunked Array

geoarrow.rust.core.GeoChunkedArray

A chunked GeoArrow array.

This class is used to handle chunked arrays in GeoArrow, which can be composed of multiple chunks of data.

null_count property

null_count: int

The number of null values in the chunked array.

num_chunks property

num_chunks: int

Return the number of chunks in the array.

type property

type: GeoType

Return the type of the chunked array.

__arrow_c_stream__

__arrow_c_stream__(requested_schema: object | None = None) -> 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.chunked_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) -> GeoChunkedArray

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

chunk

chunk(i: int) -> GeoArray

Return the i-th chunk of the array.

chunks

chunks() -> list[GeoArray]

Return all chunks of the array.

downcast

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

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

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

from_arrow classmethod

Import from an Arrow chunked array/stream 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(capsule: object) -> GeoChunkedArray