diff --git a/crates/h3arrow/Cargo.toml b/crates/h3arrow/Cargo.toml index 58fbb00..dee729d 100644 --- a/crates/h3arrow/Cargo.toml +++ b/crates/h3arrow/Cargo.toml @@ -21,8 +21,7 @@ spatial_index = ["dep:rstar"] [dependencies] ahash = "0.8" arrow = { workspace = true } -# geoarrow = { package = "geoarrow", version = "0.1.0", optional = true, features = ["geozero"] } -geoarrow = { package = "geoarrow", git = "https://github.com/geoarrow/geoarrow-rs.git", rev = "30c18f7c07432dfb92f9612efa54aec1d9392daf", optional = true, features = ["geozero"] } +geoarrow = { version = "0.3", optional = true, features = ["geozero"] } geo-types = { workspace = true } geo = { workspace = true } geozero = { version = "^0.13", default-features = false, features = ["with-geo", "with-wkb"], optional = true } diff --git a/crates/h3arrow/src/array/from_geoarrow.rs b/crates/h3arrow/src/array/from_geoarrow.rs index b4b2a6c..ee1e150 100644 --- a/crates/h3arrow/src/array/from_geoarrow.rs +++ b/crates/h3arrow/src/array/from_geoarrow.rs @@ -58,12 +58,12 @@ macro_rules! impl_to_cells { }; } -impl_to_cells!(geoarrow::array::LineStringArray, O); -impl_to_cells!(geoarrow::array::MultiLineStringArray, O); -impl_to_cells!(geoarrow::array::MultiPointArray, O); -impl_to_cells!(geoarrow::array::MultiPolygonArray, O); -impl_to_cells!(geoarrow::array::PointArray); -impl_to_cells!(geoarrow::array::PolygonArray, O); +impl_to_cells!(geoarrow::array::LineStringArray, O); +impl_to_cells!(geoarrow::array::MultiLineStringArray, O); +impl_to_cells!(geoarrow::array::MultiPointArray, O); +impl_to_cells!(geoarrow::array::MultiPolygonArray, O); +impl_to_cells!(geoarrow::array::PointArray<2>); +impl_to_cells!(geoarrow::array::PolygonArray, O); impl ToCellListArray for WKBArray { fn to_celllistarray( diff --git a/crates/h3arrow/src/array/to_geoarrow.rs b/crates/h3arrow/src/array/to_geoarrow.rs index e034b3b..5c56c57 100644 --- a/crates/h3arrow/src/array/to_geoarrow.rs +++ b/crates/h3arrow/src/array/to_geoarrow.rs @@ -3,6 +3,7 @@ use crate::array::to_geo::{ }; use crate::array::{H3Array, H3IndexArrayValue}; use arrow::array::{Array, OffsetSizeTrait}; +use geo::point; use geo_types::LineString; use geoarrow::array::{ LineStringArray, PointArray, PolygonArray, WKBArray, WKBBuilder, WKBCapacity, @@ -13,7 +14,7 @@ pub trait ToGeoArrowPolygons { fn to_geoarrow_polygons( &self, use_degrees: bool, - ) -> Result, Self::Error>; + ) -> Result, Self::Error>; } impl ToGeoArrowPolygons for T @@ -25,14 +26,14 @@ where fn to_geoarrow_polygons( &self, use_degrees: bool, - ) -> Result, Self::Error> { + ) -> Result, Self::Error> { Ok(self.to_polygons(use_degrees)?.into()) } } pub trait ToGeoArrowPoints { type Error; - fn to_geoarrow_points(&self, use_degrees: bool) -> Result; + fn to_geoarrow_points(&self, use_degrees: bool) -> Result, Self::Error>; } impl ToGeoArrowPoints for T @@ -40,7 +41,7 @@ where T: ToPoints, { type Error = T::Error; - fn to_geoarrow_points(&self, use_degrees: bool) -> Result { + fn to_geoarrow_points(&self, use_degrees: bool) -> Result, Self::Error> { Ok(self.to_points(use_degrees)?.into()) } } @@ -50,7 +51,7 @@ pub trait ToGeoArrowLineStrings { fn to_geoarrow_lines( &self, use_degrees: bool, - ) -> Result, Self::Error>; + ) -> Result, Self::Error>; } impl ToGeoArrowLineStrings for T @@ -61,7 +62,7 @@ where fn to_geoarrow_lines( &self, use_degrees: bool, - ) -> Result, Self::Error> { + ) -> Result, Self::Error> { Ok(self.to_linestrings(use_degrees)?.into()) } } @@ -197,7 +198,8 @@ where .is_some() { let mut cap = WKBCapacity::new_empty(); - cap.add_point(true); + let point = point! {x:0.0f64, y:0.0f64}; + cap.add_point(Some(&point)); cap.buffer_capacity() } else { 0 diff --git a/h3ronpy/Cargo.toml b/h3ronpy/Cargo.toml index fdc7448..4a39a44 100644 --- a/h3ronpy/Cargo.toml +++ b/h3ronpy/Cargo.toml @@ -25,6 +25,6 @@ ndarray = { version = "0.15", features = ["rayon"] } numpy = "0.21" ordered-float = ">=2.0.1" py_geo_interface = { version = "0.8", features = ["f64", "wkb"] } -pyo3 = { version = "0.21", features = ["extension-module", "abi3", "abi3-py39"] } +pyo3 = { version = "^0.21", features = ["extension-module", "abi3", "abi3-py39"] } rasterh3 = { version = "^0.8", features = ["rayon"] } rayon = { workspace = true }