[geos-devel] [GEOS] #1071: Setting lower precision of polygon always collapses polygon

GEOS geos-trac at osgeo.org
Mon Nov 23 13:34:07 PST 2020


#1071: Setting lower precision of polygon always collapses polygon
--------------------------+--------------------------
 Reporter:  Brendan Ward  |      Owner:  geos-devel@…
     Type:  defect        |     Status:  new
 Priority:  major         |  Milestone:
Component:  Default       |    Version:  3.5.1
 Severity:  Unassigned    |   Keywords:
--------------------------+--------------------------
 Used via C API GEOSGeom_setPrecision_r.

 Given an input polygon WKT: "POLYGON ((0 0, 0.1 0, 0.1 0.1, 0 0.1, 0 0))"
 and a gridSize of 1.

 With flags unset (0), this causes the polygon to collapse to an empty
 polygon (expected): "POLYGON EMPTY"

 With flags set to keep collapsed elements, the polygon is still collapsed
 to an empty polygon (unexpected).

 The expected output is "POLYGON ((0 0, 0 0, 0 0, 0 0, 0 0))".

 In contrast, a linear ring behaves as expected.  Given an input of
 "LINEARRING (0 0, 0.1 0, 0.1 0.1, 0 0.1, 0 0)":

 flag not set: "LINEARRING EMPTY"
 flag set: "LINEARRING (0 0, 0 0, 0 0, 0 0, 0 0)"

-- 
Ticket URL: <https://trac.osgeo.org/geos/ticket/1071>
GEOS <http://trac.osgeo.org/geos>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).


More information about the geos-devel mailing list