MOD function for contours
Say you have 1’ or 5’ contours with an elevation field. Instead of calculating a new field or making selections, you can use the mod function. I find it extremely useful.
In the definition query tab of your layer properties:
mod("Contour",25)=0
The mod expression above divides the Contour value by 25 and throws out any values that don’t have a remainder of 0.
This will return only Contour values divisible by 25 – you can also use this to make quicker selections if you do need to calculate a field. This can also be used in labelling class definition queries, so if you want to show all contours but only label 50’ contours, use the expression mod("Contour",50)=0.
Before
After mod("Contour",25)=0
1 Comment
Langdon
September 26, 2014If using SQL Server database and receive an error message of “‘MOD’ is not a recognized built-in function name” use the % operator instead of mod( )
ELEVATION % 25 = 0