Plotting geological dips against a dip/strike symbol

93 views
Skip to first unread message

Grant Boxer

unread,
May 11, 2025, 9:32:11 PM5/11/25
to australian-qg...@googlegroups.com

Hi All,

 

I am trying to format labels associated with dip and strike symbols on geological maps. The traditional way is to plot the dip value next to the small tick on the dip/strike symbol. The problem is how to move the label automatically to where the little tick mark is. I am thinking the geometry generator should be able to do this with an expression like move the label to a quadrant based on the dip direction at a set distance from the centroid of the symbol.

Has anyone managed to do this?

 

Cheers Grant

 

box...@iinet.net.au

unread,
May 12, 2025, 4:49:48 AM5/12/25
to australian-qg...@googlegroups.com

Hi All,

 

I think I have answered my own question. See description below.

 

Check to see which is the required field to control the label location. In this example it is the dip direction. Set the label placement options to “Offset from point”, open the data-driven override next to the Quadrant icons. Enter the CASE statement as shown below.

 

 

 

A screenshot of a computer

AI-generated content may be incorrect.

 

Note the location of the label as referenced from the centroid of the dip-strike symbol.

0 = above left, 1 = above, 2 = above right, 3 = left, 4 = over, 5 = right, 6 = below left, 7 = below, 8 = below right.

 

Grant Boxer, May 2025.

--
You received this message because you are subscribed to the Google Groups "QGIS Australia User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to australian-qgis-use...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/australian-qgis-user-group/022f01dbc2dd%24ab7cb7c0%2402762740%24%40iinet.net.au.

image001.jpg
image002.jpg

Emma Hain

unread,
May 12, 2025, 7:17:36 PM5/12/25
to australian-qg...@googlegroups.com
Thanks Grant!

Kind regards
Em

Emma Hain — Product Manager/Senior GIS Analyst
em...@north-road.com
https://north-road.com
North Road
Cartography • Development • Spatial Analysis


north-road.com

QGIS User Conference 2025
2-3 June,
Norrköping, Sweden
FOSS4G 2025
17-23 November, Auckland, New Zealand


Colin Mazengarb

unread,
May 13, 2025, 5:04:26 AM5/13/25
to QGIS Australia User Group
Hi Grant,

here is my method for labelling. I also use rule-based labelling for excluding vertical and horizontal values where no value is required. Note that I discovered this code from an Irish QGIS website many years ago so cannot claim originality.

Hoping this is helpful.

cheers
Colin

   Controlling dip value labelling

In order to replicate a geological survey-type map appearance where dip values are placed relative to the orientation of the symbol rotation, such as what is shown on the example above, then some coding is required in the labelling Placement options and using the Offset from Point mode.

For classic dip and strike type symbols the data defined override code expects a string formatted as X,Y as follows:

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

·         The code assumes that a DipDirection field exists (representing the dip direction). If your field name is different, then this is where it can be changed.

·         The two 90 values relate to the initial orientation of the symbol (where no rotation is applied) and can be adjusted to suit. In my example the symbol tick points in the eastward direction by default and requires a -90 correction. Easy to change if your symbols start facing north in which case remove the '+90' bit in each case.

·         The -4 and -5 control the distance for the label to be placed from the centre of the symbol and can be changed to suit your own preference. 

box...@iinet.net.au

unread,
May 13, 2025, 5:45:03 AM5/13/25
to australian-qg...@googlegroups.com

Hi Colin,

 

Many thanks for that. I thought someone must have done it somewhere.

 

Where do I place the code string? I have tried a few places but doesn’t seem to work for me.

 

Cheers Grant

 

 

From: australian-qg...@googlegroups.com <australian-qg...@googlegroups.com> On Behalf Of Colin Mazengarb
Sent: Tuesday, 13 May 2025 5:04 PM
To: QGIS Australia User Group <australian-qg...@googlegroups.com>
Subject: Re: [QGIS-Australia-User-Group] Plotting geological dips against a dip/strike symbol

 

Hi Grant,

 

here is my method for labelling. I also use rule-based labelling for excluding vertical and horizontal values where no value is required. Note that I discovered this code from an Irish QGIS website many years ago so cannot claim originality.

 

Hoping this is helpful.

 

cheers

Colin

 

   Controlling dip value labelling

In order to replicate a geological survey-type map appearance where dip values are placed relative to the orientation of the symbol rotation, such as what is shown on the example above, then some coding is required in the labelling Placement options and using the Offset from Point mode.

For classic dip and strike type symbols the data defined override code expects a string formatted as X,Y as follows:

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

·         The code assumes that a DipDirection field exists (representing the dip direction). If your field name is different, then this is where it can be changed.

·         The two 90 values relate to the initial orientation of the symbol (where no rotation is applied) and can be adjusted to suit. In my example the symbol tick points in the eastward direction by default and requires a -90 correction. Easy to change if your symbols start facing north in which case remove the '+90' bit in each case.

·         The -4 and -5 control the distance for the label to be placed from the centre of the symbol and can be changed to suit your own preference. 

 

 

On Tuesday, May 13, 2025 at 9:17:36AM UTC+10 em...@north-road.com wrote:

Thanks Grant!

 

Kind regards

Em

 

Emma Hain — Product Manager/Senior GIS Analyst
em...@north-road.com

Colin Mazengarb

unread,
May 13, 2025, 7:52:35 PM5/13/25
to australian-qg...@googlegroups.com
Grant: should have added screenshots in my comment. See image below for settings and yellow data override button next to Offset X,Y is where the code goes.

cheers
Colin


From: boxerg via QGIS Australia User Group <australian-qg...@googlegroups.com>
Sent: Tuesday, May 13, 2025 7:44 PM
To: australian-qg...@googlegroups.com <australian-qg...@googlegroups.com>
Subject: RE: [QGIS-Australia-User-Group] Plotting geological dips against a dip/strike symbol
 

Grant Boxer

unread,
May 13, 2025, 8:26:20 PM5/13/25
to australian-qg...@googlegroups.com
image001.png
Reply all
Reply to author
Forward
0 new messages