uber / h3-java

Java bindings for H3, a hierarchical hexagonal geospatial indexing system
https://uber.github.io/h3/
Apache License 2.0
267 stars 53 forks source link

[Feature Req] Polyfill for multi level inclusion/exclusion #35

Open alexjikim opened 5 years ago

alexjikim commented 5 years ago

Curious if there is any plan to add polyfill support for more complex geofences that have inclusions within 'holes'

For instance in s2, inclusion/exclusion is determined by the number of geofences a point is contained by and therefore doesn't require an explicit 'holes' input in the api.

Snippet from s2 java comments: /*

nrabinowitz commented 5 years ago

Thanks for the suggestion!

The short answer is that we don't have a specific plan to improve this, but we are considering revising our approach to geo polygon data structures in the next major version, and may consider multi-polygon support for polyfill. The holes API is admittedly a little awkward, but it follows the GeoJSON semantics of requiring the caller to identify the outside loop and any holes and put them in appropriate order. To date, we have not required loop coordinates to follow a specific winding order, but we may add this restraint in the next major version as well.