[postgis-users] Angle

Ezequias Rodrigues da Rocha ezequias at recife.pe.gov.br
Thu Jul 6 10:05:26 PDT 2006


marco vieira escreveu:
> Ezequias:
>  Look at postgis documentation. azimuth() returns radians, not 
> degrees. You must divide by pi rad and multiply by 180 degrees to 
> obtain 124,9 degrees. Make sure your azimuth is 143,9 by manual 
> calculation using start and end points (make sure you are using the 
> same start and end points).
> Regards.
> -- 
> Marco Vieira
> +55 21 9499-6800
> e-mail: maovieira at gmail.com <mailto:maovieira at gmail.com>
> 2006/7/6, Ezequias Rodrigues da Rocha <ezequias at recife.pe.gov.br 
> <mailto:ezequias at recife.pe.gov.br>>:
>
>
>
>     Arnaud Lesauvage escreveu:
>     > Ezequias Rodrigues da Rocha wrote:
>     >> Ok, now I need to get the start and and point of a linestring
>     >> feature. Could you tell me please ?
>     >>
>     >> Regards
>     >> Ezequias
>     >>
>     >> Arnaud Lesauvage escreveu:
>     >>> Ezequias Rodrigues da Rocha wrote:
>     >>>> Hi list,
>     >>>>
>     >>>> Could someone tell me how to get an angle of a linestring
>     feature ?
>     >>>>
>     >>>> Regards...
>     >>>>
>     >>>
>     >>> The azimuth(geometry, geometry) function might be what you are
>     >>> looking for.
>     >>> Input geometries are points, so you might use
>     >>> Azimuth(StartPoint(geometry), EndPoint(geometry)) if geometry is a
>     >>> Linestring.
>     >>>
>     >>> http://postgis.refractions.net/docs/ch06.html#id2528534
>     <http://postgis.refractions.net/docs/ch06.html#id2528534>
>     >
>     >
>     > What do you think these "StartPoint" and "EndPoint" functions do ?
>     > Have you read the documentation at
>     http://postgis.refractions.net/docs/
>     <http://postgis.refractions.net/docs/> ?
>     > All you questions are answered there.
>     >
>     >
>     > PS : Please, reply below the quotes. Thanks !
>     >
>     > --
>     > Arnaud
>     >
>     > _______________________________________________
>     > postgis-users mailing list
>     > postgis-users at postgis.refractions.net
>     <mailto:postgis-users at postgis.refractions.net>
>     > http://postgis.refractions.net/mailman/listinfo/postgis-users
>     <http://postgis.refractions.net/mailman/listinfo/postgis-users>
>     >
>     Arnaud (great name. The name of my grandfather),
>
>     I tried like this but the result (as you can see now) is too below.
>
>     dbpotgis=# SELECT azimuth(startpoint(the_geom),endpoint(the_geom)) as
>     azimuth from mub where gid = 2900;
>          azimuth
>     ------------------
>     2.17998093202836
>     (1 row)
>
>     dbpotgis=#
>
>     The real angle is 143,9 and the function only rerutns 2.17...
>
>     Could you tell me what I did wrong ?
>
>     Regards ...
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users at postgis.refractions.net
>     <mailto: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
>   
Marco,

I did the following:

DesiredDegree = 180 - ColumnInRad /PI * 1 rad

Whre 1 rad = 57.29577951


Some features works someothers dont.
:-) :-(

Regards
Ezequias



More information about the postgis-users mailing list