Last active
October 10, 2021 18:24
-
-
Save agiudiceandrea/a61377b1c9940c4bfeb3f7d7fa1fd48d to your computer and use it in GitHub Desktop.
Expression to calculate bearing true-north based (loxodromic) between first and second point from current layer with UTM coordinates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- by Andrea Giudiceandrea licensed under CC-BY-SA 4.0 license | |
degrees( | |
azimuth(geometry(get_feature_by_id(@layer, 1)), geometry(get_feature_by_id(@layer, 2))) - | |
-- the grid convergence from https://gis.stackexchange.com/a/394982/107272 by Houska | |
with_variable('LL', transform( geometry(get_feature_by_id(@layer, 1)),layer_property(@layer,'crs'),'EPSG:4326'), | |
with_variable('displacedLL',translate(@LL,0,0.001), | |
azimuth(geometry(get_feature_by_id(@layer, 1)),transform(@displacedLL,'EPSG:4326',layer_property(@layer,'crs'))) | |
)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment