Label Expression Remove Every Other

841
2
03-27-2020 05:04 AM
WalterDziuba1
New Contributor III

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

0 Kudos
2 Replies
MarkBockenhauer
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

0 Kudos
UriGilad_EsriAu
Esri 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.

0 Kudos