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

Mike Toews mwtoews at gmail.com
Tue Jul 20 19:30:03 PDT 2010


Except that you need radians .. not degrees, so multiply your degrees
by pi()/180 to convert to radians.

See this similar discussion:
http://postgis.refractions.net/pipermail/postgis-users/2010-January/025752.html

-Mike

On 20 July 2010 04:57, Fred Lehodey <lehodey at gmail.com> wrote:
>
> 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
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list