Label Expression Remove Every Other

66
2
03-27-2020 05:04 AM
Highlighted
New Contributor II

Morning,

Hope everyone is safe!

I'm attempting to label contours, but I need to remove any value starting with 115, 125, 135 etc. But need to keep those that are 120, 130, 140 etc.

Function FindLabel ([Contour])
if (cLng([Contour]) = 115) then
FindLabel = ""
else
FindLabel = [Contour]
end if
End Function

This expression removes those that are 115, but how do I also remove the remaining others?

Any help would be appreciated.

Walter

Reply
0 Kudos
2 Replies
Highlighted
Esri Regular Contributor

Walter,

You could look label all values that end in '0'

var a = right($feature.Contour,1)
if (number(a) < 1) {
   a = $feature.Contour
   }
else {
    a = ''
   }
return a;

mark

Reply
0 Kudos
Highlighted
Occasional Contributor

Hi Walter, 

In your label expression, click on Advance and enter:

Function FindLabel ([ELEVATION])
If ([ELEVATION] Mod 10) = 0 Then
FindLabel = [ELEVATION]
End If
End Function

Replace Mod value if you wish to change the interval, e.g. Mod 100 if value is dividable by 100.

Placing labels for contours—Help | ArcGIS for Desktop 


If this answer solved your question or if you found it helpful please mark it accordingly to help others who have the same question.

Reply
0 Kudos