<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2>Try the trick documented here</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2><A 
href="http://postgis.refractions.net/documentation/manual-svn/ST_Collect.html">http://postgis.refractions.net/documentation/manual-svn/ST_Collect.html</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2>On hindsight - I realized the ST_Multi call here is 
probably unnecessary so you can leave that part out.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2>Regina</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=521492210-04082008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> 
postgis-users-bounces@postgis.refractions.net 
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of 
</B>danny<BR><B>Sent:</B> Monday, August 04, 2008 5:04 AM<BR><B>To:</B> PostGIS 
Users Discussion<BR><B>Subject:</B> Re: [postgis-users] Merge all polygons from 
a dataset<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr>I'm getting very long processing time from ST_Union (on a shape of 
europe at 1/100000 it's been running since 2 hours and hasn't finished yet; on 
my previous one of 1/1000000 it took ~1 hour)<BR>Any other alternative and 
quicker ways to accomplish the same operation?<BR>I just executed 
st_buffer(st_collect(the_geom)) but still waiting. Should it take as long? 
ST_Collect by itself executes fast but it's result violates the geometry check 
constraint. <BR><BR><BR><BR>
<DIV class=gmail_quote>On Fri, Aug 1, 2008 at 5:31 PM, danny <SPAN 
dir=ltr><<A 
href="mailto:whatevar89@gmail.com">whatevar89@gmail.com</A>></SPAN> 
wrote:<BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
  <DIV dir=ltr>Thanks Robert.<BR><BR>I actually exported from ogr2ogr and it 
  created a shape that worked fine in ArcView.<BR><BR>Best
  <DIV>
  <DIV></DIV>
  <DIV class=Wj3C7c><BR> <BR><BR><BR>
  <DIV class=gmail_quote>On Fri, Aug 1, 2008 at 5:19 PM, Burgholzer,Robert <SPAN 
  dir=ltr><<A href="mailto:rwburgholzer@deq.virginia.gov" 
  target=_blank>rwburgholzer@deq.virginia.gov</A>></SPAN> wrote:<BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
    <DIV lang=EN-US vlink="blue" link="blue">
    <DIV>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Could ArcView 
    perhaps want some columns other than just the shape?  Perhaps you could 
    put a numeric ID or something else in there.</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Just a 
    thought,</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P>
    <DIV>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Robert W. 
    Burgholzer</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Surface Water 
    Modeler</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Office of Water 
    Supply and Planning</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Virginia Department 
    of Environmental Quality</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><A 
    href="mailto:rwburgholzer@deq.virginia.gov" 
    target=_blank>rwburgholzer@deq.virginia.gov</A></SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">804-698-4405</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Open Source 
    Modeling Tools:</SPAN></FONT></P>
    <P><FONT face=Arial color=navy size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><A 
    href="http://sourceforge.net/projects/npsource/" 
    target=_blank>http://sourceforge.net/projects/npsource/</A></SPAN></FONT></P></DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Tahoma size=2><SPAN 
    style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">
    <DIV>-----Original Message-----<BR><B><SPAN 
    style="FONT-WEIGHT: bold">From:</SPAN></B> <A 
    href="mailto:postgis-users-bounces@postgis.refractions.net" 
    target=_blank>postgis-users-bounces@postgis.refractions.net</A> [mailto:<A 
    href="mailto:postgis-users-bounces@postgis.refractions.net" 
    target=_blank>postgis-users-bounces@postgis.refractions.net</A>] <B><SPAN 
    style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>danny<BR></DIV>
    <DIV>
    <DIV></DIV>
    <DIV><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, August 01, 
    2008 9:30 AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> PostGIS 
    Users Discussion<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> 
    Re: [postgis-users] Merge all polygons from a 
    dataset</DIV></DIV></SPAN></FONT>
    <P></P>
    <DIV>
    <DIV></DIV>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
    <DIV>
    <P style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 0.5in; MARGIN-RIGHT: 0in"><FONT 
    face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Many thanks, 
    Regina! Indeed ST_Union generated the polygon, invisible in PgAdmin!! 
    <BR><BR>It creates a nice layer when I open it in uDig. <BR><BR>However when 
    I export it with pgsql2shp, the shape is unreadable by ArcView with the 
    errmsg: Number of shapes does not match the number of table 
    records.<BR><BR>Here's how I created the layer:<BR><BR>create table 
    europe_contour();<BR>SELECT addgeometrycolumn('db, 'europe_contour', 
    'the_geom', 32767,'MULTIPOLYGON', 2 );<BR>insert into 
    europe_contour(the_geom) values( (select st_union(the_geom) from 
    europe));<BR><BR>Then I generate the shapefile: <BR><BR>"c:\Program 
    Files\PostgreSQL\8.3\bin\pgsql2shp.exe" -u postgres -P password -f 
    europe_contour db europe_contour<BR><BR>Any suggestions perhaps on anything 
    I've wrong?<BR><BR></SPAN></FONT></P>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt">On Fri, Aug 1, 2008 at 1:15 PM, Obe, Regina <<A 
    href="mailto:robe.dnd@cityofboston.gov" 
    target=_blank>robe.dnd@cityofboston.gov</A>> wrote:</SPAN></FONT></P>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Erik,</SPAN></FONT></P>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">How were you using 
    ST_Union and what exactly do you mean by no result.  no result as it 
    looks blank?  If you are using something like PgAdmin III - it will 
    look blank because it exceeds the buffer supported by PgAdmin 
    III.</SPAN></FONT></P>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">SELECT the_geom is 
    null </SPAN></FONT></P>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">FROM (somequery or 
    table) as foo</SPAN></FONT></P>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">LIMIT 
    1</SPAN></FONT></P></DIV>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">will tell you if 
    its actually returning no geometry</SPAN></FONT></P></DIV>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Hope that 
    helps,</SPAN></FONT></P></DIV>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face=Arial color=blue size=2><SPAN 
    style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">Regina</SPAN></FONT></P></DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT> </P>
    <DIV style="MARGIN-LEFT: 0.5in; TEXT-ALIGN: center" align=center><FONT 
    face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
    <HR align=center width="100%" SIZE=2>
    </SPAN></FONT></DIV>
    <P 
    style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 0.5in; MARGIN-RIGHT: 0in"><B><FONT 
    face=Tahoma size=2><SPAN 
    style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SPAN></FONT></B><FONT 
    face=Tahoma size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"> <A 
    href="mailto:postgis-users-bounces@postgis.refractions.net" 
    target=_blank>postgis-users-bounces@postgis.refractions.net</A> [mailto:<A 
    href="mailto:postgis-users-bounces@postgis.refractions.net" 
    target=_blank>postgis-users-bounces@postgis.refractions.net</A>] <B><SPAN 
    style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>danny<BR><B><SPAN 
    style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, August 01, 2008 6:12 
    AM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> <A 
    href="mailto:postgis-users@postgis.refractions.net" 
    target=_blank>postgis-users@postgis.refractions.net</A><BR><B><SPAN 
    style="FONT-WEIGHT: bold">Subject:</SPAN></B> [postgis-users] Merge all 
    polygons from a dataset</SPAN></FONT></P>
    <DIV>
    <DIV>
    <DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt">Hello everybody,<BR><BR>I've converted a shapefile 
    of Europe to PostGIS. I would like to merge all the countries together so 
    that I only have one polygon left, the whole contour of Europe. I have tried 
    ST_Union that gives me no result. I've tried several other functions to no 
    avail. Does anybody know how I should proceed?<BR><BR>Many 
    thanks,<BR><BR>Erik</SPAN></FONT></P></DIV></DIV></DIV></DIV>
    <DIV>
    <DIV style="MARGIN-LEFT: 0.5in; TEXT-ALIGN: center" align=center><FONT 
    face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
    <HR align=center width="100%" SIZE=1>
    </SPAN></FONT></DIV>
    <P style="MARGIN-LEFT: 0.5in"><B><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-WEIGHT: bold; FONT-SIZE: 12pt">The substance of this message, 
    including any attachments, may be confidential, legally privileged and/or 
    exempt from disclosure pursuant to Massachusetts law. It is intended solely 
    for the addressee. If you received this in error, please contact the sender 
    and delete the material from any computer. </SPAN></FONT></B></P></DIV>
    <DIV style="MARGIN-LEFT: 0.5in; TEXT-ALIGN: center" align=center><FONT 
    face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">
    <HR align=center width="100%" SIZE=1>
    </SPAN></FONT></DIV>
    <P style="MARGIN-LEFT: 0.5in"><B><FONT face="Times New Roman" color=#339900 
    size=2><SPAN 
    style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: rgb(51,153,0)">Help make 
    the earth a greener place. If at all possible resist printing this email and 
    join us in saving paper. </SPAN></FONT></B></P>
    <P style="MARGIN-BOTTOM: 12pt; MARGIN-LEFT: 0.5in; MARGIN-RIGHT: 0in"><FONT 
    face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"><BR>_______________________________________________<BR>postgis-users 
    mailing list<BR><A href="mailto:postgis-users@postgis.refractions.net" 
    target=_blank>postgis-users@postgis.refractions.net</A><BR><A 
    href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
    target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A></SPAN></FONT></P></DIV>
    <P style="MARGIN-LEFT: 0.5in"><FONT face="Times New Roman" size=3><SPAN 
    style="FONT-SIZE: 12pt"></SPAN></FONT> </P></DIV></DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>postgis-users 
    mailing list<BR><A href="mailto:postgis-users@postgis.refractions.net" 
    target=_blank>postgis-users@postgis.refractions.net</A><BR><A 
    href="http://postgis.refractions.net/mailman/listinfo/postgis-users" 
    target=_blank>http://postgis.refractions.net/mailman/listinfo/postgis-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>

<HTML><BODY><P><hr size=1></P>
<P><STRONG>
The substance of this message, including any attachments, may be confidential, legally privileged and/or exempt from disclosure pursuant to Massachusetts law. It is intended solely for the addressee. If you received this in error, please contact the sender and delete the material from any computer.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>