I have a list of destination polygons and a source polygon (destination and source are just used to denote polygons).
What I want to do is find area of intersection of the source polygon with each of the destination polygons
Then select the one with the maximum area of intersection.
Polygon here is list of Points, of course.
Return D4 since it has max area of intersection with S
I could not find an example to calculate area of intersection, let alone iterating and finding the maximum. Could you please help me with this in DQL
We are exploring this to evaluate the possibility of spatially linking two nodes based on the geometry which has maximum intersection.
Not currently - the intersects() function will act as a boolean function but would return D{1,2,3,4} in your case. You would have to order them by area and take the top 1 after that in your client code. I suggest creating a feature request using the template when you make a new topic here.
There is a feature request out there for string data manipulation functions - this would be the geo equivalent.
Thanks for the response.
Does Dgraph support the extensibility to write and deploy custom user defined functions.
For example: Can i write and deploy a custom function like ‘intersectsArea()’ for the above usecase on the server side of dgraph.