[postgis-users] making a line from a known point and direction

Fred Lehodey lehodey at gmail.com
Tue Jul 20 04:57:39 PDT 2010


Hi ahmet,

you can use something like that (and easily write a function):

here, the point is (0 0) : ST_makepoint(0,0)
,azimuth is 45 and distance is 50.

select st_makeline(st_makepoint(0,0),st_makepoint(xx,yy)) as the_geom
FROM
(
select
ST_x(st_makepoint(0,0)) + (50 * (sin(45))) as xx,
ST_y(st_makepoint(0,0)) + (50 * (cos(45))) as yy
) as foo


Fred.




On Tue, Jul 20, 2010 at 12:26 PM, ahmet temiz <ahmettemiz88 at gmail.com>wrote:

> hello
>
> I want to make a linestring from a known point and known direction (as
> azimuth) with
> certain length.
>
> how can I do that ?
>
> regards
> _______________________________________________
> 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/20100720/6a848550/attachment.html>


More information about the postgis-users mailing list