petern48 opened a new issue, #473: URL: https://github.com/apache/sedona-db/issues/473
In multiple PRs, now we've run across the [item_to_geometry()](https://github.com/apache/sedona-db/blob/e0e1d109480727faaf7be25923b57b4686144438/rust/sedona-geo/src/to_geo.rs#L62-L66) lack of support for POINT EMPTY, etc. The root of the problem is that `geo`'s methods simply return `None` for many of those cases. In https://github.com/apache/sedona-db/pull/233#discussion_r2619908849, @paleolimbot proposed creating a new enum to allow the caller to access the WKB directly. ``` enum ItemToGeometryResult { Unsupported(Wkb), Supported(Geometry)) ``` I thought about taking this one step further, what if we instead do something like this: ``` enum ItemToGeometryResult { PointEmpty, MultiPointEmpty, // we'd have to be extra careful here for cases like `MULTIPOINT ((EMPTY, 1 0))` Supported(Geometry), Unsupported(Wkb), // or simply just continue allowing these cases to panic since these are complicated cases anyway ``` This would allow us to avoid re-parsing the Unsupported geom's bytes again to determine that it's a empty point/polygon. This should work because we *know* what method is returning the `None` inside of the following function https://github.com/apache/sedona-db/blob/e0e1d109480727faaf7be25923b57b4686144438/rust/sedona-geo/src/to_geo.rs#L76-L87 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
