Geological Dip and Strike Label Placement in QGIS


If you are interested in automatically placing the dip value in the same position relative to the dip direction for cartographic reasons (when plotting a map) then you have come to the right place. (I must confess I have borrowed and modified this tip from the Irish QGIS site (with thanks and unfortunately cannot find the link despite some effort) but am repeating it here so that I have my tips in one location.)

To state the problem in another way, without this script the dip value will stay in the same geographic position with respect to the point symbol regardless of which way the symbol is oriented. This doesnt look good and therefore finding an automated method of displaying such information on large datasets is highly desirable.

The solution (assuming you are familiar with labelling point features in QGIS):

In the symbol placement tab of the Layer Properties, choose the Offset from Point option and place the following script in the data derived override option for the Offset X,Y input:

to_string((-4*cos(radians( "AZIMUTH"+90)))  )|| ',' ||  to_string(-5 * sin(radians( "AZIMUTH"+90 )))

The script assumes that an AZIMUTH field exists (representing the dip direction). The -4 and -5 are the spacing distances that I use. You can easily edit this to suit your own data model and alter the X,Y position as needed. 

As always, feedback and questions welcomed.

Comments

Popular posts from this blog

How to assign RGB colours to QGIS vector file

Orthorectification of historic aerial photos