# [postgis-users] Angle

marco vieira maovieira at gmail.com
Thu Jul 6 07:38:01 PDT 2006

```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
2006/7/6, Ezequias Rodrigues da Rocha <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
> >
> >
> > What do you think these "StartPoint" and "EndPoint" functions do ?
> > Have you read the documentation at http://postgis.refractions.net/docs/?
> > All you questions are answered there.
> >
> >
> >
> > --
> > Arnaud
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at postgis.refractions.net
> > 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
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060706/350f1dd6/attachment.html>
```