[Qgis-user] user defined format for new bearing tool?

Richard Greenwood richard.greenwood at gmail.com
Tue Nov 2 06:55:29 PDT 2021


Is it possible for a user to add a format to the new bearing tool in 3.22?
Cadastral descriptions in the United States are usually expressed in
degrees, minutes, seconds in four quadrants e.g.
  N 45°27'18"W or S 15°07'54"E, etc.
I have a SQL expression below that I use for labeling in that format. I
would like to add it as a format option in the bearing tool.
concat(
  case
    when degrees(azimuth(start_point($geometry), end_point($geometry)))< 90
      then CONCAT('N',to_dms(degrees(azimuth(start_point($geometry),
end_point($geometry))), 'x',0,'aligned'))
    when degrees(azimuth(start_point($geometry), end_point($geometry)))< 180
      then CONCAT('S', to_dms(180 - degrees(azimuth(start_point($geometry),
end_point($geometry))), 'x',0,'aligned'))
    when degrees(azimuth(start_point($geometry), end_point($geometry)))< 270
      then CONCAT('S', to_dms(degrees(azimuth(start_point($geometry),
end_point($geometry))) -180, 'x',0), '°W')
    else
      CONCAT('N', to_dms(360 - degrees(azimuth(start_point($geometry),
end_point($geometry))), 'x',0), 'W')
  end
)

-- 
Richard W. Greenwood
www.greenwoodmap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20211102/df769ce2/attachment.html>


More information about the Qgis-user mailing list