-
Notifications
You must be signed in to change notification settings - Fork 442
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
Large negative buffer does not return empty polygon #472
Comments
One heuristic for dealing with this is to compute the radius of the circle with the same area as the geometry. This is an upper bound on the buffer distance which will erode the polygon completely (i.e. buffer distances less than the radius should produce an empty buffer). For example, the effective radius of the geometry above is 11.970122020294427. So the distance of -15 should return an empty buffer result. However, this bound is not sufficient. A buffer distance of -11.9 still produces an erroneous non-empty polygon. The radius of the MaximumInscribedCircle is 9.475544793980276. Distance = -9.5 produces an empty result, as expected. |
More failure cases: Pentagon (max inscribed circle radius = 8.2, buffer( -9 ) is non-empty)
Pentagonal Hole (buffer( 9 ) has incorrect hole)
|
My hypothesis is that this situation occurs for rings (shells and holes) which are characterized by:
Given this, it is not too expensive to compute the buffer curve and then check if every vertex of the offset curve is closer to the ring than the specified buffer distance (with a small tolerance factor, say 1%). If this is the case, the generated buffer is actually empty, and the offset curve can be discarded from the buffer result. Note that this test must be applied to each input ring. An element is discarded if it is determined to have an empty result. Also, a related issue can happen for polygon with specific kinds of holes. In this case a range of positive buffer distances creates an incorrect result containing a hole (which should have disappeared). |
Fixed by #706. |
Computing a negative buffer on some polygons returns an "inverted" polygon rather than an empty one.
Example:
Buffer of -15 should be empty, but returns:
Originally reported on GIS StackExchange. See also GEOS 1101 and QGIS 41696.
The text was updated successfully, but these errors were encountered: