Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
alexjikim opened this issue Dec 29, 2018 · 1 comment
Open

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

alexjikim opened this issue Dec 29, 2018 · 1 comment

Comments

@alexjikim
Copy link

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:
/*

  • An S2Polygon is an S2Region object that represents a polygon. A polygon
  • consists of zero or more {@link S2Loop loops} representing "shells" and
  • "holes". All loops should be oriented CCW, i.e. the shell or hole is on the
  • left side of the loop. Loops may be specified in any order. A point is
  • defined to be inside the polygon if it is contained by an odd number of
  • loops.
    */
@nrabinowitz
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants