<font size=2 face="sans-serif">Hi All</font>
<br>
<br><font size=2 face="sans-serif">I'm having an issue with ST_Union on
a large dataset. I have a LINESTRING layer which I want to union. The layer
has been validated using ST_IsValid with no invalid geometries found. The
LINESTRING layer is formed from a large MULTIPOLYGON layer which is also
validated. The St_Union function works alright when operating on subsets
of the data but throws a nondescript error (ERROR: GEOS union() threw
an error!) when run on the whole dataset. Are there known issues with ST_Union
running on large datasets (~17000 geometries)? The SQL is below. I'm suspecting
a memory issue but can't be sure. The same error has also occurred on our
64-bit Linux machine.</font>
<br>
<br><font size=2 face="sans-serif">I've tried a number of work-arounds
with no success. Firstly I tried breaking the process up so only spatially
intersecting geometries were unioned and, secondly I've tweaked the processing
memory variables for postgres. My current settings are below.</font>
<br>
<br><font size=2 face="sans-serif">--works fine</font>
<br><font size=2 face="sans-serif">CREATE TEMP TABLE all_lines AS</font>
<br><font size=2 face="sans-serif">SELECT gid, st_boundary(geom) as geom</font>
<br><font size=2 face="sans-serif">FROM (SELECT gid, (st_dump(geom)).geom
as geom FROM featuresubset01) as foo </font>
<br><font size=2 face="sans-serif">GROUP BY gid, geom;</font>
<br>
<br><font size=2 face="sans-serif">--throws and error when run on whole
dataset</font>
<br><font size=2 face="sans-serif">CREATE TEMP TABLE noded_lines AS</font>
<br><font size=2 face="sans-serif">SELECT St_Union(geom) AS geom</font>
<br><font size=2 face="sans-serif">FROM all_lines;</font>
<br>
<br><font size=2 face="sans-serif">Postgres Memory Settings:</font>
<br><font size=2 face="sans-serif">shared_buffers = 150MB</font>
<br><font size=2 face="sans-serif">temp_buffers = 25MB</font>
<br><font size=2 face="sans-serif">work_mem = 5MB</font>
<br><font size=2 face="sans-serif">maintenance_work_mem = 16MB</font>
<ul>
<li></ul>
<br><font size=2 face="sans-serif">Cheers</font>
<br>
<br><font size=2 face="sans-serif">Adrian</font>
<br><font size=3><br>
</font>
<br><font size=2 face="sans-serif">Environ Specs:</font>
<ul>
<li><font size=2 face="sans-serif">Postgres 8.4.8</font>
<li><font size=2 face="sans-serif">PostGIS 1.5.3</font>
<li><font size=2 face="sans-serif">Windows XP 32-bit SP3</font>
<li><font size=2 face="sans-serif">3.25GB RAM</font></ul>
<P><FONT face=Arial size=2>Notice:</FONT><FONT
style="BACKGROUND-COLOR: #ff0000"><BR></FONT><FONT size=2><FONT face=Arial>This
email and any attachments may contain information that is personal,
confidential,<BR>legally privileged and/or copyright.</FONT> <FONT face=Arial>No
part of it should be reproduced, adapted or communicated </FONT><FONT
face=Arial>without the prior written consent of the copyright owner.
</FONT></FONT></P>
<P><FONT size=2><FONT face=Arial>It is the responsibility of the recipient to
check for and remove viruses.</FONT></FONT></P>
<P><FONT face=Arial size=2>If you have received this email in error, please
notify the sender by return email, delete it from your system and destroy any
copies. You are not authorised to use, communicate or rely on the information
contained in this email.</FONT></P>
<P><FONT face=Arial color=#008000 size=2>Please consider the environment before
printing this email.</FONT></P>
<P><FONT face=Arial size=2></FONT> </P>
<P> </P>
<P> </P>