kylebarron commented on code in PR #8222: URL: https://github.com/apache/arrow-rs/pull/8222#discussion_r2299086684
########## arrow-schema/src/extension/canonical/geometry.rs: ########## @@ -0,0 +1,136 @@ +use crate::extension::ExtensionType; +use crate::ArrowError; + +/// Geospatial features in the WKB format with linear/planar edges interpolation +#[derive(Debug, Default, Clone, PartialEq, Eq, Hash)] +pub struct Geometry { + crs: Option<String>, +} + +impl Geometry { + /// Create a new Geometry extension type with an optional CRS. + pub fn new(crs: Option<String>) -> Self { + Self { crs } + } + + /// Get the CRS of the Geometry type, if any. + pub fn crs(&self) -> Option<&str> { + self.crs.as_deref() + } +} + +impl ExtensionType for Geometry { + const NAME: &'static str = "geoarrow.wkb"; + + type Metadata = (); Review Comment: It's important for edge interpolation, at least, to be stored under an `Option`, because that's the primary thing that separates a geometry from a geography (and that's how to discern whether input data with extension name `geoarrow.wkb` is a geometry or a geography). FWIW it may be preferable to vendor the existing [`WkbType` struct](https://docs.rs/geoarrow-schema/latest/geoarrow_schema/struct.WkbType.html) that's already in use in `geoarrow-schema`. It's not clear that we should have separate `Geometry`/`Geography` arrow extension types. They're implemented here to parallel the Parquet implementation, but perhaps should be removed in favor of a single `WkbType` or similar. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org