<!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=411260712-01052008><FONT face=Arial 
color=#0000ff size=2>I wouldn't quite call it runnning the function in that 
table.  Basically the SQL statement will create a temporary or in memory 
table so to speak.  So short answer - yes it is correct - no need to create 
a new table or geometry column.  Sometimes you may want to if you use it 
often or you are grouping many geometries since the planner has to recalculate 
each time if it is a dynamic query as below or view (a saved dynamic query as 
Kevin pointed out in last post) .</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=411260712-01052008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=411260712-01052008><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=411260712-01052008><FONT face=Arial 
color=#0000ff size=2>Well there should be an alias there otherwise it usually 
will just alias it as something dumb like ST_Union - so let me correct my 
mistake.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=411260712-01052008>SELECT somefield, 
ST_Union(the_geom) as newgeom<BR>FROM sometable<BR>GROUP BY 
somefield;</SPAN></DIV>
<DIV><SPAN class=411260712-01052008></SPAN> </DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>If you 
wanted to materialize it, I tend to do something like</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>SELECT 
somefield, <FONT face="Times New Roman" color=#000000 size=3>ST_Union(the_geom) 
as newgeom</FONT><BR>INTO somenewtable</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>FROM 
sometable</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>GROUP 
BY somefield;</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>A lot 
of people do </FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>CREATE 
TABLE somenewtable As </FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>SELECT 
somefield, <FONT face="Times New Roman" color=#000000 size=3>ST_Union(the_geom) 
as newgeom</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>FROM 
sometable</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>GROUP 
BY somefield;</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>But I 
tend to avoid that second syntax since its not as portable as option 1 (from 
DBMS to DBMS at least the DBMS I tend to deal with) and the speed is the 
same.  Granted</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>I 
guess the second version is a bit clearer.</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff size=2>Hope 
that helps,</FONT></SPAN></DIV>
<DIV><SPAN class=411260712-01052008><FONT face=Arial color=#0000ff 
size=2>Regina</FONT></SPAN></DIV></SPAN><SPAN class=411260712-01052008></DIV>
<DIV dir=ltr align=left><BR></DIV></SPAN><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>George Silva<BR><B>Sent:</B> Wednesday, April 30, 2008 10:47 
PM<BR><B>To:</B> PostGIS Users Discussion<BR><B>Subject:</B> Re: [postgis-users] 
Line To Path<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV>In the same trailing of that question and the answer, that select statement 
would run the function st_union in that table, without the need to create a new 
table or geometry column?</DIV>
<DIV> </DIV>
<DIV>Sorry to use this post for this, just tought its a quite novice question, 
so more people could use the answer.</DIV>
<DIV> </DIV>
<DIV>Thx</DIV>
<DIV> </DIV>
<DIV>Att.</DIV>
<DIV> </DIV>
<DIV>George<BR><BR></DIV>
<DIV class=gmail_quote>On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation 
<<A href="mailto:lr@pcorp.us">lr@pcorp.us</A>> wrote:<BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Bob,<BR><BR>If 
  I understand you correctly, I think you want to use one of the 
  following<BR><BR>SELECT somefield, ST_Union(the_geom)<BR>FROM 
  sometable<BR>GROUP BY somefield<BR><BR>So lets say you want to collapse 3 rows 
  into 1 then you just need to group<BR>by some common field.<BR><BR>E.g. if 
  somefield = 1 for your 3 records, then those would get rolled into<BR>the same 
  record.<BR><BR>The above will give you a LINESTRING or MULTILINESTRING. 
   If you have all<BR>LINESTRINGS, then may be more efficient to do this. 
   The below will first<BR>collapse all with common somefield into a 
  MULTILINESTRING and then the<BR>LineMerge will do the best it can to stitch 
  back into a single line string.<BR>This is not possible with completely 
  disjoint linestrings.<BR><BR>SELECT somefield, 
  ST_LineMerge(ST_Collect(the_geom))<BR>FROM sometable<BR>GROUP BY 
  somefield<BR><BR><BR>If you are using the older version of Postgis, you can 
  just take out the ST_<BR>in the examples I have above.<BR><BR>Hope that 
  helps,<BR>Regina<BR>
  <DIV>
  <DIV></DIV>
  <DIV class=Wj3C7c><BR>-----Original Message-----<BR>From: <A 
  href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</A><BR>[mailto:<A 
  href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</A>] 
  On Behalf Of Bob<BR>Pawley<BR>Sent: Wednesday, April 30, 2008 12:40 PM<BR>To: 
  PostGIS Users Discussion<BR>Subject: [postgis-users] Line To Path<BR><BR>Is 
  there a method of converting three lines that require three rows into 
  a<BR>path that occupies a single row??<BR><BR>Bob 
  Pawley<BR><BR>_______________________________________________<BR>postgis-users 
  mailing list<BR><A 
  href="mailto:postgis-users@postgis.refractions.net">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><BR><BR>_______________________________________________<BR>postgis-users 
  mailing list<BR><A 
  href="mailto:postgis-users@postgis.refractions.net">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></DIV></DIV></BLOCKQUOTE></DIV><BR></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>