[Qgis-user] Azimuth and orientation of 2 features

Alexandre Rodier alex.rodier at yahoo.es
Mon Feb 13 14:04:12 PST 2023


Hi all.
I asked yesterday how to resolve this problem: 
"I need to calculate the orientation (North, East, South or North) of a feature (Polygon, a parcel) respect of another one (Line, a road).I calculated the azimuth of the two features using the centroids of each but the formulas I found don't really work, or I am doing something wrong (it's probably that :-) )."
Thanks to Nicolas Cadieux I found this solution:
degrees( azimuth( make_point( to_real( "Cen_X" ),to_real( "Cen_Y" ) ), make_point(to_real( "X-centr" ),to_real( "Y-centr" )) ) )

Where Cent_X, Cent_Y, X-centr and Y-centr are respectively the centroides of my road and my parcels.
Regards.
--------------------------
Alexandre Rodier
Geógrafo  Turismo sostenible 
Telf: +34 661 38 00 28http://www.entretierras.com+ info: https://www.linkedin.com/in/alexrodier/
--------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20230213/18b67b88/attachment.htm>


More information about the QGIS-User mailing list