[postgis-users] Retrieve Line coordinates from geometry.

Rodrigo Martín LÓPEZ GREGORIO rodrigomlg at gmail.com
Thu Jul 5 08:12:59 PDT 2007


Hi Broun.

If you want the start point of a linestring then you must use:

StartPoint(the_geom)

This function returns a POINT with the coordinates of the start point from
the_geom (for the end point you should use EndPoint(the_geom))

If you want to get the X and Y coordinates you should use the X() and Y()
functions with that points like:

X(StartPoint(the_geom)) and Y(StartPoint(the_geom))

Rodrigo.

On 7/5/07, Broun Uganda <tekuganda at hotmail.com> wrote:
>
> Dear all,
> Am trying to use the postgis reference to extract coordinates (x & y) for
> the starting and ending of a line from the_geom to enable me draw points
> at the starting and ending of that line. Please advise me which function i
> should use in my trigger function.
> I want to do something like this:
> UPDATE points SET the_geom = MakePoint(New.lines.the_geom(s),-1); where
> (s) refers to start of line geometry & (e) refers to end  of line geometry
> UPDATE points SET the_geom = MakePoint(New.lines.the_geom(e),-1);
>
>
> Thanks
>
> Broun
>
>
> ------------------------------
> Make every IM count. Download Windows Live Messenger and join the i'm
> Initiative now. It's free.   Make it count!<http://im.live.com/messenger/im/home/?source=TAGWL_June07>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070705/5f87c039/attachment.html>


More information about the postgis-users mailing list