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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

geos-2
#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).

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1071: Setting lower precision of polygon always collapses polygon

geos-2
#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    |  Resolution:
 Keywords:                |
--------------------------+---------------------------

Comment (by mdavis):

 The goal of GEOS operations is to always produce valid output.  A polygon
 with zero extent is invalid, so the closest valid result is `POLYGON
 EMPTY`.  Another way to put this is that if a polygon collapses completely
 due to rounding, it disappears rather than becoming a point.

 The collapsed LinearRing result is in fact also invalid.  So probably the
 current result  is out of spec, and should be changed to become
 `LINEARRING EMPTY`.  (In fact this should be the behaviour of the latest
 GEOS version incorporating OverlayNG).

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

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel
Reply | Threaded
Open this post in threaded view
|

Re: [GEOS] #1071: Setting lower precision of polygon always collapses polygon

geos-2
In reply to this post by geos-2
#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    |  Resolution:
 Keywords:                |
--------------------------+---------------------------

Comment (by Brendan Ward):

 It might be useful to clarify the intent of the flag to keep collapsed
 elements; it is not clear what collapsed elements should be retained,
 since their collapse implies that they are no longer toplogically valid.

 Decisions here also affect line strings as well.  Given an input of
 "LINESTRING (0 0, 0.1 0.1)" and gridSize of 1, with this flag set, it
 returns "LINESTRING (0 0, 0 0)", which is not valid (according to
 GEOSisValid_r).

 (have not tested on 3.9 / master)

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

_______________________________________________
geos-devel mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geos-devel