petern48 commented on issue #539:
URL: https://github.com/apache/sedona-db/issues/539#issuecomment-3785974710

   @Mehak3010, answering your questions from this comment: 
https://github.com/apache/sedona-db/issues/174#issuecomment-3785290178 here to 
pull out the conversation to a separate issue.
   
   
   `geos` has a convenient `relate()` method we can use. Hopefully, 
implementing this will be as simple as calling that.
   
https://github.com/georust/geos/blob/f7566bdef3052201e71052756ebb73c6c9e03056/src/geometry.rs#L533-L538
   
   > 1. Which geometry combinations should be supported in the initial version 
(e.g., Point–Polygon, Polygon–Polygon)?
   
   Generally, we aim to support all combinations of all different types, or at 
least match what PostGIS supports. I'm optimistic this will happen 
automatically if we use `geos`'s `relate()` method I mentioned above.
   
   > 2. Should the function return a full DE-9IM relation matrix string, or do 
you prefer a simplified/partial implementation for v1?
   
   So there's three different function headers that PostGIS ST_Relate() 
supports according to the [docs](https://postgis.net/docs/ST_Relate.html):
   
   ```
   boolean ST_Relate(geometry geomA, geometry geomB, text 
intersectionMatrixPattern);
   
   text ST_Relate(geometry geomA, geometry geomB);
   
   text ST_Relate(geometry geomA, geometry geomB, integer boundaryNodeRule);
   ```
   
   I think any individual PR should add full support for a function header. 
It's okay to implement just one of these three (in fact, I'd personally prefer 
that) in the PR, but it should be fully (not partially) support all cases for 
that function (e.g. point-polygon, polygon-polygon, etc). The other versions of 
ST_Relate could be implemented as separate PRs.
    
   > 3. Are there existing geometry kernels or utilities in SedonaDB that you 
recommend reusing for this logic?
   
   I wrote a fairly in-depth PR in the past to guide a contributor to 
implementing a ST_ function using a `geos` method. Check it out: 
https://github.com/apache/sedona-db/pull/288
   
   > 4. Any preferences around performance optimizations or test coverage for 
this function?
   
   Don't worry about perf optimizations. Check out a previous `geos` PR (e.g. 
the one I put above) for an example of test coverage. We need them both at the 
rust and python level.


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

Reply via email to