[postgis-tickets] [PostGIS] #4182: Unexpected TopologyException during ST_Union aggregate function with valid polygons

PostGIS trac at osgeo.org
Thu Aug 22 08:40:42 PDT 2019


#4182: Unexpected TopologyException during ST_Union aggregate function with valid
polygons
-----------------------+--------------------------
  Reporter:  blaggner  |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS GEOS
 Component:  postgis   |    Version:  2.3.x
Resolution:            |   Keywords:
-----------------------+--------------------------

Comment (by mdavis):

 Of course one way to deal with the "tiny holes" is to simply remove holes
 of less than a given area.  However, it can happen (although not
 necessarily in your dataset) that the spurious holes are actually long
 slivers, which can have significant area but a very small cross-section.
 A while ago I did some work on code to identify this sort of geometry, and
 it worked pretty well.  (One way is to buffer the sliver ring with a small
 negative distance and see if it disappears)

 There is also the potential for gores (inward thin spikes).  These require
 a different approach to deal with.

 Which brings us to the question about whether the explicit precision model
 in the new overlay code can help with this.  Unfortunately, the answer is
 "not entirely".  Many times it does cause slivers to collapse away.  But
 there can be cases where the sliver is actually widened by the grid
 snapping, in which case of course it still shows up as a hole.

 The technical reason for this is that the snap-rounding is space-driven,
 rather than data-driven.  So if two nearby vertices happen to lie  in
 adjacent grid cells rather than the same one, they are snapped apart
 rather than together.

 (It would be a very interesting project to try and implement a data-driven
 snapping facility.  This would be relatively easy to do up to the 95%
 level, but getting to 100% in a safe way is a challenge.  Other systems
 such as Arc do provide something like this, so it is possible...)

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4182#comment:9>
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