<!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>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2>Bob,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2>1) You mean empty as the geometry fields are empty or you
get no records back? If it looks empty, check to make sure it actually
is. For example in pgadmin large geometries look blank. If you get
no records, then most liked you have no records in processes or no records in
tank_lin tagged as 'Tank.dxf' (keep in mind that PostgreSQL is case
sensitive so the casing of Tank.dxf has to be right)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2>2) Your statement doesn't quite look right, but not quite
clear what you are trying to do.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008> <FONT
face=Arial color=#0000ff size=2>a) Don't group by the_geom. That is
basically grouping by the bounding box of a geometry which is something I doubt
you want to do.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008> <FONT
face=Arial color=#0000ff size=2>b) HAVING should be used for aggregate filter
clauses only. In theory you can use it as you are but usually gets
processed after the WHERE and grouping </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN
class=739380912-02052008> <FONT
face=Arial color=#0000ff size=2>so is better suited for clauses such as HAVING
area2d(SUM(the_geom)) > 1000 something involving aggregating data.
Since you are doing a simple attribute query change your HAVING to a WHERE and
move up in your statement.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008> <FONT
face=Arial color=#0000ff size=2>c) You are missing JOINS to join your
tables together. This might actually be okay if you are trying to make a
permutation of every record in library.processes with every Tank.dxf and then
unioning together all with the same file_dxf. I just</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008> <FONT
face=Arial color=#0000ff size=2>point it out because in 95% of the cases when
people do it, its a mistake.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2>So given above try the following</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2>SELECT geomunion(tank_lin.the_geom) As
newgeom</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2>FROM public.tank_lin (think about whether you want a INNER
JOIN, LEFT JOIN, CROSS JOIN (which is same as ,) here and if you want and
INNER or LEFT what are the fields to join with)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN
class=739380912-02052008>
<FONT face=Arial color=#0000ff size=2>library.processes (ON ... if you are using
an INNER or LEFT public.tank_lin.somefield1 =
library.processes.somefield2)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
color=#0000ff size=2>WHERE <FONT color=#000000>public.tank_lin.file_dxf =
'Tank.dxf'</FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><FONT face=Arial
size=2>GROUP BY public.tank_lin.file_dxf,
library.processes.wkt_coordinate;</FONT></SPAN></DIV>
<DIV><SPAN class=739380912-02052008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=739380912-02052008><FONT face=Arial size=2><FONT
color=#0000ff>Hope that helps,</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=739380912-02052008><FONT face=Arial size=2><FONT
color=#0000ff>Regina</FONT></DIV>
<DIV dir=ltr align=left><BR></DIV></FONT></SPAN>
<DIV dir=ltr align=left><SPAN class=739380912-02052008><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>Bob
Pawley<BR><B>Sent:</B> Thursday, May 01, 2008 5:32 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><FONT face=Arial size=2>I'm having a some trouble making this
work.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I run this command and get the return from the
table return that I expect.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Select tank_lin.the_geom as
newgeom<BR> from public.tank_lin;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>However, when I run the geomunion command
-</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Select geomunion(tank_lin.the_geom) as
newgeom<BR> From public.tank_lin,
library.processes<BR> Group by public.tank_lin.the_geom,
public.tank_lin.file_dxf,
library.processes.wkt_coordinate<BR> Having file_dxf =
'Tank.dxf' ; </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I get an empty return.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm missing something.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Bob</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="http://www.automatingdesign.com">www.automatingdesign.com</A>
</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=rjpawley@shaw.ca href="mailto:rjpawley@shaw.ca">Bob Pawley</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=postgis-users@postgis.refractions.net
href="mailto:postgis-users@postgis.refractions.net">PostGIS Users
Discussion</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, May 01, 2008 8:25
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [postgis-users] Line To
Path</DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial size=2>Thanks all for your help</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Bob Pawley</FONT></DIV>
<DIV><FONT face=Arial size=2><A
href="http://www.automatingdesign.com">www.automatingdesign.com</A>
</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=robe.dnd@cityofboston.gov
href="mailto:robe.dnd@cityofboston.gov">Obe, Regina</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=postgis-users@postgis.refractions.net
href="mailto:postgis-users@postgis.refractions.net">PostGIS Users
Discussion</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, May 01, 2008 5:19
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [postgis-users] Line To
Path</DIV>
<DIV><BR></DIV>
<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>
<P>
<HR SIZE=1>
<P></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>
<P>
<HR SIZE=1>
<P></P>
<P><STRONG><FONT color=#339900 size=2>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>
<P>
<HR>
<P></P>_______________________________________________<BR>postgis-users
mailing
list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE>
<P>
<HR>
<P></P>_______________________________________________<BR>postgis-users
mailing
list<BR>postgis-users@postgis.refractions.net<BR>http://postgis.refractions.net/mailman/listinfo/postgis-users<BR></BLOCKQUOTE></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>