paleolimbot commented on code in PR #8222:
URL: https://github.com/apache/arrow-rs/pull/8222#discussion_r2299615162


##########
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:
   I think the Parquet spec chose to separate them because this is how those 
types are separated in most database systems. GeoArrow/GeoParquet predated the 
Parquet spec change, had fairly wide implementation support already, and thus 
couldn't make the breaking change to match it so here we all are 🙂 .
   
   For what it's worth I usually just store `enum EdgeType { Planar, Spherical, 
... }` and handle the fact that in JSON the `"edge_type"` key is supposed to be 
omitted on serialization/serialization.



-- 
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

Reply via email to