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.
__arrow_c_stream__ ¶
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.
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
, orWktView
. Point
toMultiPoint
LineString
toMultiLineString
Polygon
toMultiPolygon
Fallible casts:¶
Geometry
to any other native type.- Parsing
WKB
orWKT
to any native type other thanGeometry
. MultiPoint
toPoint
MultiLineString
toLineString
MultiPolygon
toPolygon
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
¶
from_arrow(data: ArrowStreamExportable) -> GeoChunkedArray
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.