Obe, Regina | 1 May 2008 14:19
Favicon

RE: Line To Path

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) .
 
 
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.
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
If you wanted to materialize it, I tend to do something like
 
SELECT somefield, ST_Union(the_geom) as newgeom
INTO somenewtable
FROM sometable
GROUP BY somefield;
 
A lot of people do
CREATE TABLE somenewtable As
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
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
I guess the second version is a bit clearer.
 
Hope that helps,
Regina


From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of George Silva
Sent: Wednesday, April 30, 2008 10:47 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Line To Path

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?
 
Sorry to use this post for this, just tought its a quite novice question, so more people could use the answer.
 
Thx
 
Att.
 
George

On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation <lr <at> pcorp.us> wrote:
Bob,

If I understand you correctly, I think you want to use one of the following

SELECT somefield, ST_Union(the_geom)
FROM sometable
GROUP BY somefield

So lets say you want to collapse 3 rows into 1 then you just need to group
by some common field.

E.g. if somefield = 1 for your 3 records, then those would get rolled into
the same record.

The above will give you a LINESTRING or MULTILINESTRING.  If you have all
LINESTRINGS, then may be more efficient to do this.  The below will first
collapse all with common somefield into a MULTILINESTRING and then the
LineMerge will do the best it can to stitch back into a single line string.
This is not possible with completely disjoint linestrings.

SELECT somefield, ST_LineMerge(ST_Collect(the_geom))
FROM sometable
GROUP BY somefield


If you are using the older version of Postgis, you can just take out the ST_
in the examples I have above.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces <at> postgis.refractions.net
[mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Wednesday, April 30, 2008 12:40 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Line To Path

Is there a method of converting three lines that require three rows into a
path that occupies a single row??

Bob Pawley

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

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.

Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Bob Pawley | 1 May 2008 17:57
Picon
Favicon

Re: Line To Path

I do have another novice question, if I may.
 
I have a non-geographical object whose shape is defined by coordinates. These coordinates not ony establishe the shape of the object but also the objects relative size and its position on the canvas.
 
Is there a method of using just the shape of the object dynamically resizing it and choosing its placement on the canvas?
 
Bob Pawley
 
----- Original Message -----
Sent: Thursday, May 01, 2008 5:19 AM
Subject: RE: [postgis-users] Line To Path

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) .
 
 
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.
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
If you wanted to materialize it, I tend to do something like
 
SELECT somefield, ST_Union(the_geom) as newgeom
INTO somenewtable
FROM sometable
GROUP BY somefield;
 
A lot of people do
CREATE TABLE somenewtable As
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
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
I guess the second version is a bit clearer.
 
Hope that helps,
Regina


From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of George Silva
Sent: Wednesday, April 30, 2008 10:47 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Line To Path

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?
 
Sorry to use this post for this, just tought its a quite novice question, so more people could use the answer.
 
Thx
 
Att.
 
George

On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation <lr <at> pcorp.us> wrote:
Bob,

If I understand you correctly, I think you want to use one of the following

SELECT somefield, ST_Union(the_geom)
FROM sometable
GROUP BY somefield

So lets say you want to collapse 3 rows into 1 then you just need to group
by some common field.

E.g. if somefield = 1 for your 3 records, then those would get rolled into
the same record.

The above will give you a LINESTRING or MULTILINESTRING.  If you have all
LINESTRINGS, then may be more efficient to do this.  The below will first
collapse all with common somefield into a MULTILINESTRING and then the
LineMerge will do the best it can to stitch back into a single line string.
This is not possible with completely disjoint linestrings.

SELECT somefield, ST_LineMerge(ST_Collect(the_geom))
FROM sometable
GROUP BY somefield


If you are using the older version of Postgis, you can just take out the ST_
in the examples I have above.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces <at> postgis.refractions.net
[mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Wednesday, April 30, 2008 12:40 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Line To Path

Is there a method of converting three lines that require three rows into a
path that occupies a single row??

Bob Pawley

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

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.

Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Brent Wood | 1 May 2008 21:47

Re: Line To Path


--- Bob Pawley <rjpawley <at> shaw.ca> wrote:

> I do have another novice question, if I may.
> 
> I have a non-geographical object whose shape is defined by coordinates. These
> coordinates not ony establishe the shape of the object but also the objects
> relative size and its position on the canvas.
> 
> Is there a method of using just the shape of the object dynamically resizing
> it and choosing its placement on the canvas?

Hi Bob,

Import it with no projection (SRID = -1) into PostGIS, or check the Proj4 docs
about the syntax to create a custom XY projection, & insert this into your
PostGIS spatial_ref_sys table, then use that, but I don't see that as necessary
as you won't be reprojecting it anyway.

As long as all your features are defined by coordinates which put them in the
right place on your page, relative to each other, that may work well enough for
you. 

Cheers,

  Brent Wood
Martin Davis | 1 May 2008 18:07
Favicon

Re: Line To Path

I would say you want to apply an affine transform to the object.  This 
is supported in PostGIS, but I don't know the syntax offhand.

Bob Pawley wrote:
> I do have another novice question, if I may.
>  
> I have a non-geographical object whose shape is defined by 
> coordinates. These coordinates not ony establishe the shape of the 
> object but also the objects relative size and its position on the canvas.
>  
> Is there a method of using just the shape of the object dynamically 
> resizing it and choosing its placement on the canvas?
>  
> Bob Pawley
> www.automatingdesign.com <http://www.automatingdesign.com>
>  
>
>     ----- Original Message -----
>     *From:* Obe, Regina <mailto:robe.dnd <at> cityofboston.gov>
>     *To:* PostGIS Users Discussion
>     <mailto:postgis-users <at> postgis.refractions.net>
>     *Sent:* Thursday, May 01, 2008 5:19 AM
>     *Subject:* RE: [postgis-users] Line To Path
>
>     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) .
>      
>      
>     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.
>     SELECT somefield, ST_Union(the_geom) as newgeom
>     FROM sometable
>     GROUP BY somefield;
>      
>     If you wanted to materialize it, I tend to do something like
>      
>     SELECT somefield, ST_Union(the_geom) as newgeom
>     INTO somenewtable
>     FROM sometable
>     GROUP BY somefield;
>      
>     A lot of people do
>     CREATE TABLE somenewtable As
>     SELECT somefield, ST_Union(the_geom) as newgeom
>     FROM sometable
>     GROUP BY somefield;
>      
>     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
>     I guess the second version is a bit clearer.
>      
>     Hope that helps,
>     Regina
>
>
>     ------------------------------------------------------------------------
>     *From:* postgis-users-bounces <at> postgis.refractions.net
>     [mailto:postgis-users-bounces <at> postgis.refractions.net] *On Behalf
>     Of *George Silva
>     *Sent:* Wednesday, April 30, 2008 10:47 PM
>     *To:* PostGIS Users Discussion
>     *Subject:* Re: [postgis-users] Line To Path
>
>     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?
>      
>     Sorry to use this post for this, just tought its a quite novice
>     question, so more people could use the answer.
>      
>     Thx
>      
>     Att.
>      
>     George
>
>     On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation <lr <at> pcorp.us
>     <mailto:lr <at> pcorp.us>> wrote:
>
>         Bob,
>
>         If I understand you correctly, I think you want to use one of
>         the following
>
>         SELECT somefield, ST_Union(the_geom)
>         FROM sometable
>         GROUP BY somefield
>
>         So lets say you want to collapse 3 rows into 1 then you just
>         need to group
>         by some common field.
>
>         E.g. if somefield = 1 for your 3 records, then those would get
>         rolled into
>         the same record.
>
>         The above will give you a LINESTRING or MULTILINESTRING.  If
>         you have all
>         LINESTRINGS, then may be more efficient to do this.  The below
>         will first
>         collapse all with common somefield into a MULTILINESTRING and
>         then the
>         LineMerge will do the best it can to stitch back into a single
>         line string.
>         This is not possible with completely disjoint linestrings.
>
>         SELECT somefield, ST_LineMerge(ST_Collect(the_geom))
>         FROM sometable
>         GROUP BY somefield
>
>
>         If you are using the older version of Postgis, you can just
>         take out the ST_
>         in the examples I have above.
>
>         Hope that helps,
>         Regina
>
>         -----Original Message-----
>         From: postgis-users-bounces <at> postgis.refractions.net
>         <mailto:postgis-users-bounces <at> postgis.refractions.net>
>         [mailto:postgis-users-bounces <at> postgis.refractions.net
>         <mailto:postgis-users-bounces <at> postgis.refractions.net>] On
>         Behalf Of Bob
>         Pawley
>         Sent: Wednesday, April 30, 2008 12:40 PM
>         To: PostGIS Users Discussion
>         Subject: [postgis-users] Line To Path
>
>         Is there a method of converting three lines that require three
>         rows into a
>         path that occupies a single row??
>
>         Bob Pawley
>
>         _______________________________________________
>         postgis-users mailing list
>         postgis-users <at> postgis.refractions.net
>         <mailto:postgis-users <at> postgis.refractions.net>
>         http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
>         _______________________________________________
>         postgis-users mailing list
>         postgis-users <at> postgis.refractions.net
>         <mailto:postgis-users <at> postgis.refractions.net>
>         http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>     ------------------------------------------------------------------------
>
>     *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. *
>
>     ------------------------------------------------------------------------
>
>     *Help make the earth a greener place. If at all possible resist
>     printing this email and join us in saving paper. *
>
>     * *
>
>     ------------------------------------------------------------------------
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users <at> postgis.refractions.net
>     http://postgis.refractions.net/mailman/listinfo/postgis-users
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> postgis-users mailing list
> postgis-users <at> postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>   

--

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
Bob Pawley | 1 May 2008 17:25
Picon
Favicon

Re: Line To Path

Thanks all for your help
 
Bob Pawley
----- Original Message -----
Sent: Thursday, May 01, 2008 5:19 AM
Subject: RE: [postgis-users] Line To Path

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) .
 
 
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.
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
If you wanted to materialize it, I tend to do something like
 
SELECT somefield, ST_Union(the_geom) as newgeom
INTO somenewtable
FROM sometable
GROUP BY somefield;
 
A lot of people do
CREATE TABLE somenewtable As
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
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
I guess the second version is a bit clearer.
 
Hope that helps,
Regina


From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of George Silva
Sent: Wednesday, April 30, 2008 10:47 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Line To Path

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?
 
Sorry to use this post for this, just tought its a quite novice question, so more people could use the answer.
 
Thx
 
Att.
 
George

On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation <lr <at> pcorp.us> wrote:
Bob,

If I understand you correctly, I think you want to use one of the following

SELECT somefield, ST_Union(the_geom)
FROM sometable
GROUP BY somefield

So lets say you want to collapse 3 rows into 1 then you just need to group
by some common field.

E.g. if somefield = 1 for your 3 records, then those would get rolled into
the same record.

The above will give you a LINESTRING or MULTILINESTRING.  If you have all
LINESTRINGS, then may be more efficient to do this.  The below will first
collapse all with common somefield into a MULTILINESTRING and then the
LineMerge will do the best it can to stitch back into a single line string.
This is not possible with completely disjoint linestrings.

SELECT somefield, ST_LineMerge(ST_Collect(the_geom))
FROM sometable
GROUP BY somefield


If you are using the older version of Postgis, you can just take out the ST_
in the examples I have above.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces <at> postgis.refractions.net
[mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Wednesday, April 30, 2008 12:40 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Line To Path

Is there a method of converting three lines that require three rows into a
path that occupies a single row??

Bob Pawley

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

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.

Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Bob Pawley | 1 May 2008 23:31
Picon
Favicon

Re: Line To Path

I'm having a some trouble making this work.
 
I run this command and get the return from the table return that I expect.
 
Select tank_lin.the_geom as newgeom
   from public.tank_lin;
 
However, when I run the geomunion command -
 
Select  geomunion(tank_lin.the_geom) as newgeom
   From public.tank_lin, library.processes
   Group by public.tank_lin.the_geom, public.tank_lin.file_dxf, library.processes.wkt_coordinate
   Having file_dxf = 'Tank.dxf' ;
 
I get an empty return.
 
I'm missing something.
 
Bob
----- Original Message -----
From: Bob Pawley
Sent: Thursday, May 01, 2008 8:25 AM
Subject: Re: [postgis-users] Line To Path

Thanks all for your help
 
Bob Pawley
----- Original Message -----
Sent: Thursday, May 01, 2008 5:19 AM
Subject: RE: [postgis-users] Line To Path

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) .
 
 
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.
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
If you wanted to materialize it, I tend to do something like
 
SELECT somefield, ST_Union(the_geom) as newgeom
INTO somenewtable
FROM sometable
GROUP BY somefield;
 
A lot of people do
CREATE TABLE somenewtable As
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
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
I guess the second version is a bit clearer.
 
Hope that helps,
Regina


From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of George Silva
Sent: Wednesday, April 30, 2008 10:47 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Line To Path

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?
 
Sorry to use this post for this, just tought its a quite novice question, so more people could use the answer.
 
Thx
 
Att.
 
George

On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation <lr <at> pcorp.us> wrote:
Bob,

If I understand you correctly, I think you want to use one of the following

SELECT somefield, ST_Union(the_geom)
FROM sometable
GROUP BY somefield

So lets say you want to collapse 3 rows into 1 then you just need to group
by some common field.

E.g. if somefield = 1 for your 3 records, then those would get rolled into
the same record.

The above will give you a LINESTRING or MULTILINESTRING.  If you have all
LINESTRINGS, then may be more efficient to do this.  The below will first
collapse all with common somefield into a MULTILINESTRING and then the
LineMerge will do the best it can to stitch back into a single line string.
This is not possible with completely disjoint linestrings.

SELECT somefield, ST_LineMerge(ST_Collect(the_geom))
FROM sometable
GROUP BY somefield


If you are using the older version of Postgis, you can just take out the ST_
in the examples I have above.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces <at> postgis.refractions.net
[mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Wednesday, April 30, 2008 12:40 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Line To Path

Is there a method of converting three lines that require three rows into a
path that occupies a single row??

Bob Pawley

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

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.

Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Obe, Regina | 2 May 2008 14:22
Favicon

RE: Line To Path

Bob,
 
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)
2) Your statement doesn't quite look right, but not quite clear what you are trying to do.
    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.
    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
        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.
    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
    point it out because in 95% of the cases when people do it, its a mistake.
 
So given above try the following
 
SELECT geomunion(tank_lin.the_geom) As newgeom
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)
            library.processes (ON ... if you are using an INNER or LEFT public.tank_lin.somefield1 = library.processes.somefield2)
WHERE public.tank_lin.file_dxf = 'Tank.dxf'
GROUP BY public.tank_lin.file_dxf, library.processes.wkt_coordinate;
 
Hope that helps,
Regina

 

From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Bob Pawley
Sent: Thursday, May 01, 2008 5:32 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Line To Path

I'm having a some trouble making this work.
 
I run this command and get the return from the table return that I expect.
 
Select tank_lin.the_geom as newgeom
   from public.tank_lin;
 
However, when I run the geomunion command -
 
Select  geomunion(tank_lin.the_geom) as newgeom
   From public.tank_lin, library.processes
   Group by public.tank_lin.the_geom, public.tank_lin.file_dxf, library.processes.wkt_coordinate
   Having file_dxf = 'Tank.dxf' ;
 
I get an empty return.
 
I'm missing something.
 
Bob
----- Original Message -----
From: Bob Pawley
Sent: Thursday, May 01, 2008 8:25 AM
Subject: Re: [postgis-users] Line To Path

Thanks all for your help
 
Bob Pawley
----- Original Message -----
Sent: Thursday, May 01, 2008 5:19 AM
Subject: RE: [postgis-users] Line To Path

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) .
 
 
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.
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
If you wanted to materialize it, I tend to do something like
 
SELECT somefield, ST_Union(the_geom) as newgeom
INTO somenewtable
FROM sometable
GROUP BY somefield;
 
A lot of people do
CREATE TABLE somenewtable As
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
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
I guess the second version is a bit clearer.
 
Hope that helps,
Regina


From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of George Silva
Sent: Wednesday, April 30, 2008 10:47 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Line To Path

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?
 
Sorry to use this post for this, just tought its a quite novice question, so more people could use the answer.
 
Thx
 
Att.
 
George

On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation <lr <at> pcorp.us> wrote:
Bob,

If I understand you correctly, I think you want to use one of the following

SELECT somefield, ST_Union(the_geom)
FROM sometable
GROUP BY somefield

So lets say you want to collapse 3 rows into 1 then you just need to group
by some common field.

E.g. if somefield = 1 for your 3 records, then those would get rolled into
the same record.

The above will give you a LINESTRING or MULTILINESTRING.  If you have all
LINESTRINGS, then may be more efficient to do this.  The below will first
collapse all with common somefield into a MULTILINESTRING and then the
LineMerge will do the best it can to stitch back into a single line string.
This is not possible with completely disjoint linestrings.

SELECT somefield, ST_LineMerge(ST_Collect(the_geom))
FROM sometable
GROUP BY somefield


If you are using the older version of Postgis, you can just take out the ST_
in the examples I have above.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces <at> postgis.refractions.net
[mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Wednesday, April 30, 2008 12:40 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Line To Path

Is there a method of converting three lines that require three rows into a
path that occupies a single row??

Bob Pawley

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

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.

Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

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.

Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
Jessica Fendos | 1 May 2008 18:06
Picon
Picon
Favicon

Re: Line To Path

I will be away from office on May 1 and May 2 and will return to
work on Mar. 5, 2008. For urgent requests, please contact Oriane
Casale at oriane.casale <at> state.mn.us or 651-259-7383. Thanks!

Jessica 
George Silva | 1 May 2008 17:01
Picon
Gravatar

Re: Line To Path

Thanks Regina!

On Thu, May 1, 2008 at 9:19 AM, Obe, Regina <robe.dnd <at> cityofboston.gov> wrote:
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) .
 
 
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.
SELECT somefield, ST_Union(the_geom) as newgeom

FROM sometable
GROUP BY somefield;
 
If you wanted to materialize it, I tend to do something like
 
SELECT somefield, ST_Union(the_geom) as newgeom
INTO somenewtable
FROM sometable
GROUP BY somefield;
 
A lot of people do
CREATE TABLE somenewtable As
SELECT somefield, ST_Union(the_geom) as newgeom
FROM sometable
GROUP BY somefield;
 
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
I guess the second version is a bit clearer.
 
Hope that helps,
Regina


From: postgis-users-bounces <at> postgis.refractions.net [mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of George Silva
Sent: Wednesday, April 30, 2008 10:47 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Line To Path

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?
 
Sorry to use this post for this, just tought its a quite novice question, so more people could use the answer.
 
Thx
 
Att.
 
George

On Wed, Apr 30, 2008 at 7:20 PM, Paragon Corporation <lr <at> pcorp.us> wrote:
Bob,

If I understand you correctly, I think you want to use one of the following

SELECT somefield, ST_Union(the_geom)
FROM sometable
GROUP BY somefield

So lets say you want to collapse 3 rows into 1 then you just need to group
by some common field.

E.g. if somefield = 1 for your 3 records, then those would get rolled into
the same record.

The above will give you a LINESTRING or MULTILINESTRING.  If you have all
LINESTRINGS, then may be more efficient to do this.  The below will first
collapse all with common somefield into a MULTILINESTRING and then the
LineMerge will do the best it can to stitch back into a single line string.
This is not possible with completely disjoint linestrings.

SELECT somefield, ST_LineMerge(ST_Collect(the_geom))
FROM sometable
GROUP BY somefield


If you are using the older version of Postgis, you can just take out the ST_
in the examples I have above.

Hope that helps,
Regina

-----Original Message-----
From: postgis-users-bounces <at> postgis.refractions.net
[mailto:postgis-users-bounces <at> postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Wednesday, April 30, 2008 12:40 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Line To Path

Is there a method of converting three lines that require three rows into a
path that occupies a single row??

Bob Pawley

_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

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.

Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper.


_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
postgis-users <at> postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Gmane