mapbox / mapbox-java

The Mapbox Java SDK – Java wrappers around Mapbox APIs and other location data
https://docs.mapbox.com/android/java/overview/
MIT License
424 stars 120 forks source link

Add turf intersect feature for polygonal intersection #1468

Open KeyG89 opened 2 years ago

KeyG89 commented 2 years ago

I would like to propose a new feature for turf java, namely polygonal intersection, which is as explained in the turf doc as a method that:

Takes two polygon or multi-polygon geometries and finds their polygonal intersection. If they don't intersect, returns null.

Screenshot 2022-07-27 at 11 57 24

It might help on various occasions while dealing with area-specific features on Android apps, for example, intersecting camera bounds with certain polygons can make a huge deal in making area-aware functionalities.

While looking for such a solution I've encountered geok library: https://github.com/piruin/geok - written in Kotlin, that apparently achieves this goal, so maybe it may be some kind of inspiration.

gangding commented 1 year ago

@allanwalkerit: I have the same request of porting turf.js' intersect function to Java. This will provide a more powerful tool than the currently available function TurfJoins

allanwalkerit commented 1 year ago

FAO @tobrun as discussed