geoarrow-rs icon indicating copy to clipboard operation
geoarrow-rs copied to clipboard

Allow coordinate builders to take in coordinates of a different dimension?

Open kylebarron opened this issue 4 months ago • 1 comments

We currently error if the dimension of a pushed geometry differs from the dimension of the builder: https://github.com/geoarrow/geoarrow-rs/blob/0866b8034350222b23abb419b23c1dc7a614e5a2/rust/geoarrow-array/src/builder/coord/separated.rs#L111-L151

Seems like it would be fine to allow passing an XYZ point to an XY builder, where the Z dimension silently gets dropped. Should we allow the other way too? Should we allow setting a default value like Builder::with_default_z_value?

kylebarron avatar Aug 08 '25 20:08 kylebarron

I suppose we could make this user-configurable. Have an option like PointBuilder::with_coordinate_policy or something like that, to allow customizing the behavior for alternate-dimension data.

enum CoordBuilderPolicy {
    FillValue(f64),
    Error
}

kylebarron avatar Oct 14 '25 22:10 kylebarron