prantogg commented on code in PR #1246: URL: https://github.com/apache/sedona/pull/1246#discussion_r1496943902
########## docs/api/sql/Function.md: ########## @@ -474,6 +474,33 @@ Output: 3.141592653589793 ``` +## ST_BestSRID + +Introduction: Returns the estimated most appropriate Spatial Reference Identifier (SRID) for a given geometry, based on its spatial extent and location. It evaluates the geometry's bounding envelope and selects an SRID that optimally represents the geometry on the Earth's surface. The function prioritizes Universal Transverse Mercator (UTM), Lambert Azimuthal Equal Area (LAEA), or falls back to the Mercator projection. + +- For geometries in the Arctic or Antarctic regions, the Lambert Azimuthal Equal Area projection is used. +- For geometries that fit within a single UTM zone and do not cross the International Date Line, a corresponding UTM SRID is chosen. +- In cases where none of the above conditions are met, or for geometries that cross the International Date Line, the function defaults to the Mercator projection. Review Comment: It does not handle geometries crossing the IDL appropriately. By the below line I mean - geometries crossing the IDL are mishandled and cause the determined SRID to default to Mercator projection SRID. The mishandling happens with the `angularWidth` and `angularHeight` calculation; this causes the `xwidth` to be much larger that 6 degrees, which defaults the SRID to mercator. > In cases where none of the above conditions are met, or for geometries that cross the International Date Line, the function defaults to the Mercator projection. -- 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: issues-unsubscr...@sedona.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org