Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MixedGeometryArray from the public API #928

Merged
merged 10 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 105 additions & 10 deletions js/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions js/src/algorithm/geo/area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ impl_area!(PolygonData);
impl_area!(MultiPointData);
impl_area!(MultiLineStringData);
impl_area!(MultiPolygonData);
impl_area!(MixedGeometryData);
impl_area!(GeometryCollectionData);

macro_rules! impl_vector {
Expand Down Expand Up @@ -61,5 +60,4 @@ impl_vector!(PolygonVector);
impl_vector!(MultiPointVector);
impl_vector!(MultiLineStringVector);
impl_vector!(MultiPolygonVector);
impl_vector!(MixedGeometryVector);
impl_vector!(GeometryCollectionVector);
2 changes: 0 additions & 2 deletions js/src/algorithm/geo/bounding_rect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ impl_bounding_rect!(PolygonData);
impl_bounding_rect!(MultiPointData);
impl_bounding_rect!(MultiLineStringData);
impl_bounding_rect!(MultiPolygonData);
impl_bounding_rect!(MixedGeometryData);
impl_bounding_rect!(GeometryCollectionData);

macro_rules! impl_vector {
Expand All @@ -46,5 +45,4 @@ impl_vector!(PolygonVector);
impl_vector!(MultiPointVector);
impl_vector!(MultiLineStringVector);
impl_vector!(MultiPolygonVector);
impl_vector!(MixedGeometryVector);
impl_vector!(GeometryCollectionVector);
2 changes: 0 additions & 2 deletions js/src/algorithm/geo/center.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ impl_center!(PolygonData);
impl_center!(MultiPointData);
impl_center!(MultiLineStringData);
impl_center!(MultiPolygonData);
impl_center!(MixedGeometryData);
impl_center!(GeometryCollectionData);

macro_rules! impl_chunked {
Expand All @@ -52,5 +51,4 @@ impl_chunked!(PolygonVector);
impl_chunked!(MultiPointVector);
impl_chunked!(MultiLineStringVector);
impl_chunked!(MultiPolygonVector);
impl_chunked!(MixedGeometryVector);
impl_chunked!(GeometryCollectionVector);
2 changes: 0 additions & 2 deletions js/src/algorithm/geo/centroid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ impl_centroid!(PolygonData);
impl_centroid!(MultiPointData);
impl_centroid!(MultiLineStringData);
impl_centroid!(MultiPolygonData);
impl_centroid!(MixedGeometryData);
impl_centroid!(GeometryCollectionData);

macro_rules! impl_chunked {
Expand Down Expand Up @@ -60,5 +59,4 @@ impl_chunked!(PolygonVector);
impl_chunked!(MultiPointVector);
impl_chunked!(MultiLineStringVector);
impl_chunked!(MultiPolygonVector);
impl_chunked!(MixedGeometryVector);
impl_chunked!(GeometryCollectionVector);
2 changes: 0 additions & 2 deletions js/src/algorithm/geo/chamberlain_duquette_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ impl_alg!(PolygonData);
impl_alg!(MultiPointData);
impl_alg!(MultiLineStringData);
impl_alg!(MultiPolygonData);
impl_alg!(MixedGeometryData);
impl_alg!(GeometryCollectionData);

macro_rules! impl_vector {
Expand Down Expand Up @@ -67,5 +66,4 @@ impl_vector!(PolygonVector);
impl_vector!(MultiPointVector);
impl_vector!(MultiLineStringVector);
impl_vector!(MultiPolygonVector);
impl_vector!(MixedGeometryVector);
impl_vector!(GeometryCollectionVector);
2 changes: 0 additions & 2 deletions js/src/algorithm/geo/convex_hull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ impl_alg!(PolygonData);
impl_alg!(MultiPointData);
impl_alg!(MultiLineStringData);
impl_alg!(MultiPolygonData);
impl_alg!(MixedGeometryData);
impl_alg!(GeometryCollectionData);

macro_rules! impl_vector {
Expand Down Expand Up @@ -57,5 +56,4 @@ impl_vector!(PolygonVector);
impl_vector!(MultiPointVector);
impl_vector!(MultiLineStringVector);
impl_vector!(MultiPolygonVector);
impl_vector!(MixedGeometryVector);
impl_vector!(GeometryCollectionVector);
2 changes: 0 additions & 2 deletions js/src/algorithm/geo/dimensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ impl_alg!(PolygonData);
impl_alg!(MultiPointData);
impl_alg!(MultiLineStringData);
impl_alg!(MultiPolygonData);
impl_alg!(MixedGeometryData);
impl_alg!(GeometryCollectionData);

macro_rules! impl_vector {
Expand All @@ -56,5 +55,4 @@ impl_vector!(PolygonVector);
impl_vector!(MultiPointVector);
impl_vector!(MultiLineStringVector);
impl_vector!(MultiPolygonVector);
impl_vector!(MixedGeometryVector);
impl_vector!(GeometryCollectionVector);
2 changes: 0 additions & 2 deletions js/src/algorithm/geo/geodesic_area.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ impl_geodesic_area!(PolygonData);
impl_geodesic_area!(MultiPointData);
impl_geodesic_area!(MultiLineStringData);
impl_geodesic_area!(MultiPolygonData);
impl_geodesic_area!(MixedGeometryData);
impl_geodesic_area!(GeometryCollectionData);

macro_rules! impl_vector {
Expand Down Expand Up @@ -168,5 +167,4 @@ impl_vector!(PolygonVector);
impl_vector!(MultiPointVector);
impl_vector!(MultiLineStringVector);
impl_vector!(MultiPolygonVector);
impl_vector!(MixedGeometryVector);
impl_vector!(GeometryCollectionVector);
5 changes: 0 additions & 5 deletions js/src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ impl_data! {
/// in-memory representation.
pub struct MultiPolygonData(pub(crate) geoarrow::array::MultiPolygonArray);
}
impl_data! {
/// An immutable array of Geometry geometries in WebAssembly memory using GeoArrow's
/// in-memory representation.
pub struct MixedGeometryData(pub(crate) geoarrow::array::MixedGeometryArray);
}
impl_data! {
/// An immutable array of GeometryCollection geometries in WebAssembly memory using GeoArrow's
/// in-memory representation.
Expand Down
1 change: 0 additions & 1 deletion js/src/ffi/to_ffi/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,5 @@ impl_data!(PolygonData);
impl_data!(MultiPointData);
impl_data!(MultiLineStringData);
impl_data!(MultiPolygonData);
impl_data!(MixedGeometryData);
impl_data!(GeometryCollectionData);
impl_data!(RectData);
5 changes: 0 additions & 5 deletions js/src/vector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ impl_vector! {
/// GeoArrow's in-memory representation.
pub struct MultiPolygonVector(pub(crate) geoarrow::chunked_array::ChunkedMultiPolygonArray);
}
impl_vector! {
/// An immutable chunked array of Geometry geometries in WebAssembly memory using
/// GeoArrow's in-memory representation.
pub struct MixedGeometryVector(pub(crate) geoarrow::chunked_array::ChunkedMixedGeometryArray);
}
impl_vector! {
/// An immutable chunked array of GeometryCollection geometries in WebAssembly memory using
/// GeoArrow's in-memory representation.
Expand Down
1 change: 0 additions & 1 deletion python/geoarrow-core/src/interop/shapely/to_shapely.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ fn pyarray_to_shapely(py: Python, input: PyArray) -> PyGeoArrowResult<Bound<PyAn
multipolygon_arr(py, array.as_ref().as_multi_polygon().clone())
}
Rect(_) => rect_arr(py, array.as_ref().as_rect().clone()),
Mixed(_, _) => via_wkb(py, array),
GeometryCollection(_, _) => via_wkb(py, array),
Geometry(_) => via_wkb(py, array),
}
Expand Down
5 changes: 1 addition & 4 deletions python/pyo3-geoarrow/src/data_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ impl PyNativeType {
coord_type.unwrap().into(),
dimension.unwrap().into(),
))),
"geometry" => Ok(Self(NativeType::Mixed(
coord_type.unwrap().into(),
dimension.unwrap().into(),
))),
"geometry" => Ok(Self(NativeType::Geometry(coord_type.unwrap().into()))),
"geometrycollection" => Ok(Self(NativeType::GeometryCollection(
coord_type.unwrap().into(),
dimension.unwrap().into(),
Expand Down
3 changes: 1 addition & 2 deletions python/pyo3-geoarrow/src/ffi/from_python/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::sync::Arc;

use crate::array::*;
use crate::scalar::*;
use geoarrow::array::MixedGeometryArray;
use geoarrow::datatypes::Dimension;
use geoarrow::io::geozero::ToMixedArray;
use geoarrow::scalar::GeometryScalar;
Expand All @@ -26,7 +25,7 @@ impl<'a> FromPyObject<'a> for PyGeometry {
let reader = GeoJsonString(json_string);

// TODO: we need a dynamic dimensionality reader
let arr: MixedGeometryArray = reader
let arr = reader
.to_mixed_geometry_array(Dimension::XY)
.map_err(|err| PyValueError::new_err(err.to_string()))?;
Ok(Self(
Expand Down
Loading
Loading