mikolalysenko / point-in-region

Fast and exact point in region location
https://mikolalysenko.github.io/point-in-region
MIT License
26 stars 2 forks source link

Explain differences to point-in-big-polygon in more detail #2

Open letmaik opened 8 years ago

letmaik commented 8 years ago

In the point-in-big-polygon repo it says "If you want to use multiple polygons/regions, you should use point-in-region instead.". Now I'm wondering what exactly the differences are, apart from handling multiple polygons.

  1. What's the difference between a region and a polygon?
  2. Can point-in-region handle multiple polygons that don't touch each other? The voronoi example seems to suggest otherwise.
  3. The point-in-region library only has slab-decomposition as a dependency, whereas point-in-big-polygon has additionally binary-search-bounds, interval-tree-ld, and robust-orientation. Why is that? I thought point-in-region is like a generalization of point-in-big-polygon for multiple polygons/regions?
  4. If I want to find out in which polygon a point lies, should I use point-in-big-polygon and run it for each polygon? Or can/should I use point-in-region which may be more efficient for that case?
letmaik commented 8 years ago

One more question:

In point-in-region, is it allowed to have multiple identical vertices? Think of having multiple polygons which share edges, but the shared edges are made up of different vertices (with the same coordinates) because the relationship that they are shared is not readily known (as in a collection of GeoJSON polygons).