<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><title></title><head><meta http-equiv="Content-type" content="text/html; charset=UTF-8" /><style type="text/css"> html, body {overflow-x: visible; } html { width:100%; height:100%;margin:0px; padding:0px; overflow-y: auto; overflow-x: auto; }body { font-size: 100.01%; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; background-color:transparent; overflow:show; background-image:none; margin:0px; padding:5px; }p { margin:0px; padding:0px; } body { font-size: 12px; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; } p { margin: 0; padding: 0; } blockquote { padding-left: 5px; margin-left: 5px; margin-bottom: 0px; margin-top: 0px; } blockquote.quote { border-left: 1px solid #CCC; padding-left: 5px; margin-left: 5px; } .misspelled { background: transparent url(//webmailerng.1und1.de/static_resource/mailclient/widgets/basic/parts/maileditor/spellchecking_underline.gif) repeat-x scroll center bottom; } .correct {} .unknown {} .ignored {}</style></head><body id="bodyElement" style="">
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?<br><br>Here's an example:<br><br>All of the source geometries are valid. When combined as multipolygon, it is invalid because of overlaps between the source-geometries.<br><br>select st_union(geom) from <br><br>(<br>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<br><br>union<br><br>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<br><br>union<br><br>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<br><br>union<br><br>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<br><p>) sub<span></span></p><p id="__paragraph__1254925802000" style=""><br><span style=""></span></p><p id="__paragraph__1254925802000" style=""><span style="">Thanks,</span><span></span></p><p id="__paragraph__1254925805000" style=""><span style="">Andreas<br></span></p><basefont size="2" face="Verdana"></body></html>