[postgis-users] ST_UNION function severely broken in Postgis 2.0.1

THX1138 ap.joseph at live.com
Mon Jun 25 21:01:50 PDT 2012


Hello,

I am trying to perform a function similar to ArcGIS erase in postgis where
the geometry of all polygons from one table are erased from all of the
polygons in another.

I have used to the following query to dump all multipart geometries to
single part geometries and repaired any issues. I then attempted to union
them together using a common id, which I would then use perform
st_difference on another layer. 

create table unioned_intersections(id serial primary key,geom_2277
geometry);
insert into unioned_intersections

with geom_dump as (select id,
st_makevalid((st_dump(geom)).geom::geometry(polygon,2277)) geom from
zone_isect)

select id, st_union(st_buffer(geom,0.0)) from geom_dump group by id;

However when I tried this, I received the following flagrant error message:


ERROR:  GEOSUnaryUnion: TopologyException: found non-noded intersection
between LINESTRING (3.11842e+06 1.00741e+07, 3.11842e+06 1.00741e+07) and
LINESTRING (3.11842e+06 1.00741e+07, 3.11843e+06 1.00741e+07) at
3118422.2903139661 10074127.332665939

********** Error **********

ERROR: GEOSUnaryUnion: TopologyException: found non-noded intersection
between LINESTRING (3.11842e+06 1.00741e+07, 3.11842e+06 1.00741e+07) and
LINESTRING (3.11842e+06 1.00741e+07, 3.11843e+06 1.00741e+07) at
3118422.2903139661 10074127.332665939
SQL state: XX000

Last Friday,I looked this up and determined that it was probably a geos bug
based on this  http://trac.osgeo.org/geos/ticket/527 ticket  , so I went
ahead and dumped my postgis (2.0.0SVN GEOS 3.3.3 GDAL 1.9.0) database built
the most recent versions of all dependencies and reinstalled hoping that
this error would be miraculously fixed and that my soul could be put at ease
by a successfully completed union query. However, I was terribly mistaken
and all morale was lost when the error arose again -completely undaunted by
the new geos release. 

I have no idea what could be wrong as the hundreds of thousands of
geometries in this table were made valid and were all of the multipolygon
type. I also checked for empty non-polygon geometry types, but sadly it had
no effect whatsoever.

Does anyone know of an easy workaround to this or some way of at least
determining which polygons are throwing this error so that I know what
percent of my dataset is susceptible and why?

I ran this function on a few different large datasets and the error showed
up every single time, yet I have never had this error with st_intersection
or any other geoprocessing function.

System Specifications:

"POSTGIS="2.0.1SVN r9761" GEOS="3.4.0dev-CAPI-1.8.0 r3691" PROJ="Rel. 4.8.0,
6 March 2012" GDAL="GDAL 2.0dev, released 2011/12/29" LIBXML="2.7.8"
LIBJSON="UNKNOWN" TOPOLOGY RASTER"

On Postgres 9.1.4 Ubuntu Linux 12.04 64 bit

Thanks,

Andrew


--
View this message in context: http://postgis.17.n6.nabble.com/ST-UNION-function-severely-broken-in-Postgis-2-0-1-tp4998600.html
Sent from the PostGIS - User mailing list archive at Nabble.com.



More information about the postgis-users mailing list