From a1ffa283be2302c7e744a38407be21f83d504b8a Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Mon, 25 Nov 2024 16:05:09 -0500 Subject: [PATCH] Unknown type native array --- rust/geoarrow/src/array/mod.rs | 1 + rust/geoarrow/src/array/unknown/array.rs | 14 ++++++++++++++ rust/geoarrow/src/array/unknown/mod.rs | 1 + rust/geoarrow/src/datatypes.rs | 4 ++++ 4 files changed, 20 insertions(+) create mode 100644 rust/geoarrow/src/array/unknown/array.rs create mode 100644 rust/geoarrow/src/array/unknown/mod.rs diff --git a/rust/geoarrow/src/array/mod.rs b/rust/geoarrow/src/array/mod.rs index adc3e8e5..0f6ed35d 100644 --- a/rust/geoarrow/src/array/mod.rs +++ b/rust/geoarrow/src/array/mod.rs @@ -40,6 +40,7 @@ pub(crate) mod offset_builder; pub(crate) mod point; pub(crate) mod polygon; pub(crate) mod rect; +pub(crate) mod unknown; pub(crate) mod util; pub(crate) mod wkt; diff --git a/rust/geoarrow/src/array/unknown/array.rs b/rust/geoarrow/src/array/unknown/array.rs new file mode 100644 index 00000000..0592e77b --- /dev/null +++ b/rust/geoarrow/src/array/unknown/array.rs @@ -0,0 +1,14 @@ +use std::sync::Arc; + +use crate::array::metadata::ArrayMetadata; +use crate::array::MixedGeometryArray; +use crate::datatypes::NativeType; + +pub struct UnknownGeometryArray { + data_type: NativeType, + + pub(crate) metadata: Arc, + + xy: MixedGeometryArray, + xyz: MixedGeometryArray, +} diff --git a/rust/geoarrow/src/array/unknown/mod.rs b/rust/geoarrow/src/array/unknown/mod.rs new file mode 100644 index 00000000..8be78299 --- /dev/null +++ b/rust/geoarrow/src/array/unknown/mod.rs @@ -0,0 +1 @@ +pub(crate) mod array; diff --git a/rust/geoarrow/src/datatypes.rs b/rust/geoarrow/src/datatypes.rs index a7969a7b..8d25441d 100644 --- a/rust/geoarrow/src/datatypes.rs +++ b/rust/geoarrow/src/datatypes.rs @@ -127,6 +127,10 @@ pub enum NativeType { /// Represents a [RectArray][crate::array::RectArray] or /// [ChunkedRectArray][crate::chunked_array::ChunkedRectArray]. Rect(Dimension), + + /// Represents a [UnknownGeometryArray][crate::array::UnknownGeometryArray] or + /// [ChunkedUnknownGeometryArray][crate::chunked_array::ChunkedUnknownGeometryArray]. + Unknown(CoordType), } /// A type enum representing "serialized" GeoArrow geometry types.