-
Notifications
You must be signed in to change notification settings - Fork 260
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
buffer on small polygons is returning null #241
Comments
@jagill Buffer should have returned an empty polygon in that case instead of null. We don't allow changing geometry type in the buffer operation. |
The buffer operation shouldn't return an empty polygon: the original "point-ish" polygon buffered should be something similar to a buffered point. Returning empty is non-intuitive; consider:
That should be similar to |
@jagill I understand that there is a logical issue here. However this is how our topological operations work. They expect topologically simple input and should make topologicaly simple output. And the OperatorBuffer only outputs polygons and never points or lines. OGCGeometry uses spatial reference 4326 that has tolerace of 1e-8 assigned in this library. So things start to be considered non-simple and will collapse when getting close to 1e-8. So there are two things here.
|
I'm confused; why would the buffer operation return a line or point? We are buffering a polygon, and thus it should return a polygon. It's the internal simplification step that is reducing the polygon to something else (point/empty/null), which then the buffer has trouble with. When you say that the buffer operation would return a line or point, then I'm worried that we're talking about different things! If |
@jagill Buffer expects topologically simple input and should produce a topologicaly simple output. When a point is buffered with 1e-9 distance, the result polygon is smaller than the tolerance, thus it is considered non-simple, and is deleted. |
Verified fix. |
Buffering very small polygons (which a user obtained by buffering a
Point
by a small amount) returnsnull
. For example,During the simplification step, the
CrackAndCluster._do()
collapses nearby points, which includes these nearby vertices. Instead of collapsing it to aPoint
, it collapses it to aPolygon
with no rings, which eventually bubbles up as anull
.This, of course, causes an NPE when used.
cc @mbasmanova
The text was updated successfully, but these errors were encountered: