[postgis-users] Problem with TopologyException

Paragon Corporation lr at pcorp.us
Wed Oct 7 10:15:21 PDT 2009


Kontakt,
 
The below works fine for me on my PostGIS 1.4 with GEOS 3.2 SVN.  Which
version of GEOS are you running?
 
Though geos 3.2 hasnt' come out yet -- it handles these topological issues
much better than GEOS 3.1 and older and others who have had these issues
have been able to resolve by just upgrading to GEOS 3.2.
 
If you happen to be on a windows box, we have GEOS 3.2 packaged in the
windows experimental 1.5 build (you can just copy over the geos*.dll from
bin to your current 1.4 install bin folder).
 
http://www.postgis.org/download/windows/experimental.php
 
If you are running on some Linux or Mac, you'll have to compile yourself.
 
Hope that helps,
Regina

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
kontakt at westwindwetter.de
Sent: Wednesday, October 07, 2009 10:30 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Problem with TopologyException


When using the new st_union with it's incredible performance, sometimes a
TopologyException occurs. The difference to older postgis or geos-versions
is, that the exception appears only as notice. I'm no longer able to handle
such exceptions in plpgsql. Is this a bug or a feature? Is there a parameter
to influence the behavior of TopologyExceptions?

Here's an example:

All of the source geometries are valid. When combined as multipolygon, it is
invalid because of overlaps between the source-geometries.

select st_union(geom) from 

(
select st_geomfromtext('POLYGON((3551852.838 5499377.446,3551852.753
5499377.266,3551755.56 5499402.252,3551757.37 5499402.35,3551757.71
5499405.31,3551759.775 5499407.683,3551787.01 5499438.98,3551814.73
5499432.27,3551868.24 5499419.32,3551870.41 5499414.73,3551856.27
5499384.73,3551852.838 5499377.446))', 31467) as geom

union

select st_geomfromtext('POLYGON((3551640.75 5499400.05,3551687.73
5499398.58,3551693.047 5499398.868,3551678.212 5499396.012,3551666.636
5499394.689,3551648.446 5499394.689,3551636.54 5499391.382,3551641.831
5499388.736,3551653.076 5499389.067,3551686.149 5499391.382,3551700.37
5499390.39,3551697.394 5499375.838,3551692.433 5499362.939,3551697.063
5499311.676,3551615.473 5499305.505,3551613.59 5499330.08,3551608.73
5499393.62,3551612.4 5499397.91,3551640.75 5499400.05))', 31467) as geom

union

select st_geomfromtext('POLYGON((3551755.56 5499402.252,3551772.758
5499397.831,3551744.688 5499398.989,3551712.277 5499397.004,3551700.37
5499390.39,3551686.149 5499391.382,3551653.076 5499389.067,3551641.831
5499388.736,3551636.54 5499391.382,3551648.446 5499394.689,3551666.636
5499394.689,3551678.212 5499396.012,3551693.047 5499398.868,3551729.82
5499400.86,3551755.56 5499402.252))', 31467) as geom

union

select st_geomfromtext('POLYGON((3551823.41 5499315.02,3551818.22
5499291.35,3551814.63 5499288.8,3551785.82 5499292.44,3551736.95
5499289.86,3551724.72 5499289.23,3551678.25 5499286.84,3551621.15
5499283.89,3551616.84 5499287.67,3551615.473 5499305.505,3551697.063
5499311.676,3551692.433 5499362.939,3551697.394 5499375.838,3551700.37
5499390.39,3551712.277 5499397.004,3551744.688 5499398.989,3551772.758
5499397.831,3551852.753 5499377.266,3551839.14 5499348.38,3551823.41
5499315.02))', 31467) as geom


) sub




Thanks,

Andreas


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20091007/30096353/attachment.html>


More information about the postgis-users mailing list