[geos-devel] RE: Building polygons from linework to replicate ESRI Union

James.Sewell at lisasoft.com James.Sewell at lisasoft.com
Mon Jan 31 19:43:24 EST 2011


Sorry the third SQL should be "FROM alineunion", not "FROM alwunionxx"

Cheers,
James Sewell
Developer
LISAsoft
________________________________
Ph: +61 3 8680 3250 Fax: +61 3 8680 3299
Level 9, 601 Bourke St, Melbourne Vic 3000
________________________________

LISAsoft is part of the A2end Group of Companies
http://www.ardec.com.au<http://www.ardec.com.au/>
http://www.lisasoft.com<http://www.lisasoft.com/>
http://www.terrapages.com<http://www.terrapages.com/>

From: geos-devel-bounces at lists.osgeo.org [mailto:geos-devel-bounces at lists.osgeo.org] On Behalf Of James.Sewell at lisasoft.com
Sent: Tuesday, 1 February 2011 11:11 AM
To: GEOS Development List
Subject: [geos-devel] Building polygons from linework to replicate ESRI Union

Hello All,

I am encountering problems with my process when I am trying to create drop polygons to linework and rebuild to polygons (as described by Paul Ramsey at http://s3.opengeo.org/postgis-power.pdf). I am doing this to replicate the ESRI Union functionality in a timely manner for large datasets. It works for the most part, but the below case if frustrating me.

The attached zip file contains SQL to insert two polygons to the ageoms table.

If you run the import SQL then the code below you will see that the bottom geom in the apoly table is joined to the upper geom due to some of the line vanishing (I understand there will be some other small geometries and am fine with this). I am unsure how this is happening from the ST_Polygonize?

Does anyone have any hints on how I could proceed in this case? If I snap to 10E-6 the problem disappears, but unfortunately 10E-8 is the maximum snap I can use on this data.

CREATE TABLE aline AS
SELECT a.the_geom AS the_geom FROM
(SELECT
(ST_Dump
(ST_Exteriorring(
(ST_Dumprings(
(ST_Dump(the_geom)).geom)).geom))).geom
AS the_geom FROM ageoms) AS a;

CREATE TABLE alineunion AS
SELECT st_union(st_collect(the_geom), ST_SetSRID('LINESTRING EMPTY', 4283)) AS the_geom FROM aline;


CREATE TABLE apoly AS
SELECT a.the_geom AS the_geom FROM
(SELECT (ST_Dump(ST_polygonize(the_geom))).geom AS the_geom FROM alwunionxx) AS a;



Cheers,
James Sewell
Developer
LISAsoft
________________________________
Ph: +61 3 8680 3250 Fax: +61 3 8680 3299
Level 9, 601 Bourke St, Melbourne Vic 3000
________________________________

LISAsoft is part of the A2end Group of Companies
http://www.ardec.com.au<http://www.ardec.com.au/>
http://www.lisasoft.com<http://www.lisasoft.com/>
http://www.terrapages.com<http://www.terrapages.com/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geos-devel/attachments/20110201/11e03d78/attachment.html


More information about the geos-devel mailing list