Re: [postgis-users] making a line from a known point and direction
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 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 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@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 > ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
Re: [postgis-users] making a line from a known point and direction
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 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@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
Re: [postgis-users] making a line from a known point and direction
El Tuesday 20 July 2010, ahmet temiz escribió: > hello > > I want to make a linestring from a known point and known direction (as > azimuth) with > certain length. > > how can I do that ? Can you calculate the final point instead of the direction? -- María Arias de Reyna Domínguez Área de Operaciones Emergya Consultoría Tfno: +34 954 51 75 77 / +34 607 43 74 27 Fax: +34 954 51 64 73 www.emergya.es ___ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
[postgis-users] making a line from a known point and direction
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@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users