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

Document expected behavior for degenerate polygons #126

Open
HansBrende opened this issue Aug 19, 2021 · 1 comment
Open

Document expected behavior for degenerate polygons #126

HansBrende opened this issue Aug 19, 2021 · 1 comment

Comments

@HansBrende
Copy link

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.

@z3dev
Copy link

z3dev commented Oct 16, 2021

See the definition of Polygon

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