[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    RE: [postgis-users] Line To Path
From:       "Paragon Corporation" <lr () pcorp ! us>
Date:       2008-04-30 22:20:15
Message-ID: 006a01c8ab10$5d492400$4e812e40 () n
[Download RAW message or body]

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@postgis.refractions.net
[mailto:postgis-users-bounces@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@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users



_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic