geoarrow / geoarrow-rs

GeoArrow in Rust, Python, and JavaScript (WebAssembly) with vectorized geometry operations
http://geoarrow.org/geoarrow-rs/
Apache License 2.0
243 stars 14 forks source link

serde serialization of crs and edges should be skipped when None #496

Closed JosiahParry closed 1 week ago

JosiahParry commented 7 months ago

Per https://github.com/geoarrow/geoarrow-r/issues/34#issuecomment-1925872634 crs and edges shouldn't return null when not set. Rather, they should be omitted. This can be configured with serde #[serde(skip_serializing_if = "Option::is_none")] on the Option field

https://github.com/geoarrow/geoarrow-rs/blob/eb94df3d998801be3c55128b4535fc9f58652b66/src/array/metadata.rs#L28-L32

kylebarron commented 7 months ago

good to know about that serde option but we should be checking if all fields are null and not even writing the metadata key in that case

kylebarron commented 1 week ago

This is solved now. Helped by https://github.com/geoarrow/geoarrow-rs/pull/719 but solved separately before that I think.