Saturday, 18 July 2015

arcgis 10.0 - Expression labelling in ArcMap: Label only where value is > 1


I have a field in a shapefile with values ranging from 1-50 and multiple listed as 0. Is there a way to label only the features where the number in the priority field is > 0?



Answer



You can put this as the label expression for the feature:


def FindLabel([yourField]):
if [yourField] is not None:
if int([yourField]) > 0:
return [yourField]
else:
return None

else:
return None

Using Python as the parser and checking the Advanced box.


Replace [yourField] with whatever field you are using to label.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...