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.
__init__ ¶
__init__(
arrays: ArrowArrayExportable | ArrowStreamExportable, type: None = None
) -> None
__init__(
arrays: Sequence[ArrowArrayExportable],
type: ArrowSchemaExportable | None = None,
) -> None
__init__(
arrays: (
ArrowArrayExportable
| ArrowStreamExportable
| Sequence[ArrowArrayExportable]
),
type: ArrowSchemaExportable | None = None,
) -> None
Construct a new GeoChunkedArray.
Parameters:
-
arrays(ArrowArrayExportable | ArrowStreamExportable | Sequence[ArrowArrayExportable]) –description
-
type(ArrowSchemaExportable | None, default:None) –description. Defaults to None.
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. PointtoMultiPointLineStringtoMultiLineStringPolygontoMultiPolygon
Fallible casts:¶
Geometryto any other native type.- Parsing
WKBorWKTto any native type other thanGeometry. MultiPointtoPointMultiLineStringtoLineStringMultiPolygontoPolygon
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.