Kontinuation commented on PR #1811: URL: https://github.com/apache/sedona/pull/1811#issuecomment-2670201394
If we have `Geography` defined as `public class Geography { private Geometry geometry; }`, we can make geometry functions work for geography using the following approach: We define an annotation named `SupportGeography` for annotating function parameters. Functions that do not treat geometry and geography differently could add this annotation to their parameters: ```java public static int nPoints(@SupportGeography Geometry geometry) { return geometry.getNumPoints(); } ``` `InferredExpression` will extract the annotations of these functions and call the delegated function even when a geography argument is passed in. It will extract the geometry value from the geography object and pass that geometry value into the function. I have not verified this idea yet, will try it out next week. This is only for functions that does not treat geometry and geography differently. For functions that has special semantic when operating on geography, we still need to support argument type based function overloading. -- 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