You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't find any documentation on what the expected behavior is for degenerate polygons (i.e., polygons formed by only 1 or 2 vertexes).
Use-case: I am trying to prevent a user from drawing polygons in certain restricted areas on a map. But to draw a polygon, you first start off with only 1, then 2 points defining the polygon (each time the user clicks the map, a new vertex is added). So, do I need to use a different library to determine if the first point, then first line segment overlaps the restricted areas, before switching to this library when the 3rd vertex is added? I'm using intersection to determine if there is any intersection.
From my own testing, it seems like intersection does not work for degenerate polygons... but it would have been nice if this were documented. Even nicer: if intersection would simply work for degenerate polygons.
The text was updated successfully, but these errors were encountered:
I can't find any documentation on what the expected behavior is for degenerate polygons (i.e., polygons formed by only 1 or 2 vertexes).
Use-case: I am trying to prevent a user from drawing polygons in certain restricted areas on a map. But to draw a polygon, you first start off with only 1, then 2 points defining the polygon (each time the user clicks the map, a new vertex is added). So, do I need to use a different library to determine if the first point, then first line segment overlaps the restricted areas, before switching to this library when the 3rd vertex is added? I'm using
intersection
to determine if there is any intersection.From my own testing, it seems like
intersection
does not work for degenerate polygons... but it would have been nice if this were documented. Even nicer: ifintersection
would simply work for degenerate polygons.The text was updated successfully, but these errors were encountered: