[postgis-tickets] [PostGIS] #4711: ST_Union loses precision on complex multilinestring geometries

PostGIS trac at osgeo.org
Tue Jun 30 08:22:24 PDT 2020


#4711: ST_Union loses precision on complex multilinestring geometries
-------------------------+---------------------------
  Reporter:  dannytoone  |      Owner:  pramsey
      Type:  defect      |     Status:  new
  Priority:  medium      |  Milestone:  PostGIS 3.1.0
 Component:  postgis     |    Version:  3.0.x
Resolution:              |   Keywords:
-------------------------+---------------------------

Comment (by pramsey):

 It reproduces.

 You've managed to produce a data set that has a lot of cases in it where
 the line intersection routines produce numerical precision problems
 (leading to the dreaded "TopologyException" error).

 In an attempt to recover from TopologyExceptions, GEOS has fallback code
 that tries to perturb the geometry in hopes of side-stepping the precision
 issues. That code includes a routine that progressively strips precision
 from the inputs. This is almost 100% for sure the problem. Amazingly, it
 does eventually succeed in getting to an answer without an exception.
 Unfortunately, that answer is garbage.

 The alternative, unfortunately, would be turning off the fallbacks and
 having the calculation simply stop when it hits the exception.

 My colleague Martin Davis and I are working on bringing a more robust
 algorithm for overlay (union/difference/intersection) from JTS into GEOS,
 I'll point him to your data so he can ensure that the new algorithm does
 in fact correctly handle it. If we are fortunate it will be in GEOS 3.9 in
 the fall.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4711#comment:4>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list