[postgis-users] points to polyline or polygon

Randy James rjames57 at yahoo.com
Tue Jul 15 15:02:59 PDT 2003


Hi

Well seems like it could work.

I plan to use an autonumber to ensure the points are in the
 order the user clicked on the screen.

Collect places them in the order it finds them i guess? If
so the autonumber should work?

Cheers
Randy
--- chodgson at refractions.net wrote:
> You definitely do NOT want to do this - the COLLECT()
> aggregate function 
> doesn't gauarantee any sort of order in the points it has
> collected. 
> Furthermore, a Multipoint object is not necessarily
> ordered (it will always 
> list the points in the same order, but not by necessity,
> only because it is 
> simplest). 
> 
> The best way to solve this problem is to select your list
> of points from the 
> table (they will also need to have an "order" column in
> order to make sure they 
> are made into a line in the correct order) and use PHP or
> your language of 
> choice to build a new WKT string. 
> 
> HTH.
> 
> Chris
> 
> > This is an interesting question to me.  If I understand
> correctly, you want
> > to "cast" a set of points into a linestring.  Getting
> your list of points
> > should be as easy as:
> > 
> > SELECT COLLECT(the_geom) FROM mytable GROUP BY
> somefield.
> > 
> > But this returns the geometry as MULTIPOINT, which
> isn't really want you
> > want, but if you see the text representation, it does
> look like a
> > linestring:
> > 
> > SRID=-1;MULTIPOINT(596681.75 5830977.5,532989.625
> 5869892,547653.0625
> > 5808612,608081.1875 5799629)
> > 
> > So can anyone else give a pointer on taking the above
> output and casting it
> > into a linestring instead?
> > 
> > Tyler
> 
> 
> 
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
>
http://postgis.refractions.net/mailman/listinfo/postgis-users


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com



More information about the postgis-users mailing list