2010YOUY01 commented on code in PR #90:
URL: https://github.com/apache/sedona-db/pull/90#discussion_r2355987007
##########
rust/sedona-functions/src/st_geometrytype.rs:
##########
@@ -87,20 +85,35 @@ impl SedonaScalarKernel for STGeometryType {
}
}
-fn invoke_scalar(item: &Wkb) -> Result<Option<String>> {
- match item.as_type() {
- geo_traits::GeometryType::Point(_) => Ok(Some("ST_Point".to_string())),
- geo_traits::GeometryType::LineString(_) =>
Ok(Some("ST_LineString".to_string())),
- geo_traits::GeometryType::Polygon(_) =>
Ok(Some("ST_Polygon".to_string())),
- geo_traits::GeometryType::MultiPoint(_) =>
Ok(Some("ST_MultiPoint".to_string())),
- geo_traits::GeometryType::MultiLineString(_) =>
Ok(Some("ST_MultiLineString".to_string())),
- geo_traits::GeometryType::MultiPolygon(_) =>
Ok(Some("ST_MultiPolygon".to_string())),
- geo_traits::GeometryType::GeometryCollection(_) => {
- Ok(Some("ST_GeometryCollection".to_string()))
- }
-
- // Other geometry types in geo that we should not get here: Rect,
Triangle, Line
- _ => sedona_internal_err!("unexpected geometry type"),
+/// Fast-path inference of geometry type name from raw WKB bytes
+/// An error will be thrown for invalid WKB bytes input
+///
+/// Spec: https://libgeos.org/specifications/wkb/
+///
+/// TODO: Move it to `Wkb` crate
Review Comment:
Addressed in
[df88be5](https://github.com/apache/sedona-db/pull/90/commits/df88be5f08779b27da527633d3e54969bc859716)
--
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]