BlakeOrth commented on code in PR #8222: URL: https://github.com/apache/arrow-rs/pull/8222#discussion_r2299076500
########## 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: A string in theory allows for fully arbitrary metadata, which seems undesirable. I think the metadata would normalize between GEOMETRY and GEOGRAPHY if we enforced the default values for CRS and Edge Interpolation for GEOMETRY types: > GEOMETRY is used for geospatial features in the Well-Known Binary (WKB) format with linear/planar edges interpolation. -- 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