buffer on small polygons is returning null
See original GitHub issueBuffering very small polygons (which a user obtained by buffering a Point
by a small amount) returns null
. For example,
OGCGeometry p = OGCGeometry.fromText(
"POLYGON ((177.0 64.0, 177.0000000001 64.0, 177.0000000001 64.0000000001, 177.0 64.0000000001, 177.0 64.0))"
);
OGCGeometry buffered = p.buffer(0.01);
assertIsNull(buffered);
During the simplification step, the CrackAndCluster._do()
collapses nearby points, which includes these nearby vertices. Instead of collapsing it to a Point
, it collapses it to a Polygon
with no rings, which eventually bubbles up as a null
.
This, of course, causes an NPE when used.
cc @mbasmanova
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
#176 (Buffer returns empty geometry though it should not be ...
I created a small python script that returns an EMPTY polygon when called with a geos lib compiled without debug. Called with a...
Read more >shapely object.buffer(0) return a empty polygon(coordinates ...
Most of the polygons have been processed properly,but there are still few polygons returned empty,which coordinates are empty array. The result ...
Read more >Dissolve causes 'No Shapely geometry can be created from ...
the Error says that your polygons do have a self intersection at the given coordinates, to avoid it you will have to reconstruct...
Read more >ST_Buffer - PostGIS
Computes a POLYGON or MULTIPOLYGON that represents all points whose distance from a geometry/geography is less than or equal to a given distance....
Read more >SDO_GEOM.SDO_BUFFER
This function returns a geometry object representing the buffer polygon. ... this function should be used only for relatively small geometries: geometries ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.