I'm doing Maplex-Python labels for municipality polys with yields positive, zeroes and null values. I want to label all municipality polys by their municipality name, however I don't want to display yield labels for municipality polys with zero or null yield values. E.g. Bighorn and Ranchland have zero yield values and so yield values aren't labeled but their municipality name is labeled. However, my "else:" labels don't seem to plot municipality names - polys with "null" values - unnamed polys left to Bighorn and above Ranchland. What am I doing wrong?
def FindLabel ( [fcastyld.WH_D_L], [fcastyld.WH_D_H], [fcastyld.WH_D_A], [municipalities.NAME] ):
if long([fcastyld.WH_D_A]) > 0:
label = "L" + [fcastyld.WH_D_L] + "H" + [fcastyld.WH_D_H] + "A" + [fcastyld.WH_D_A] + "\n" + "<FNT name='Arial Narrow' size='5'><ITA><CLR red='104' green='104' blue='104'>" + [municipalities.NAME] + "</CLR></ITA></FNT>"
else:
label = "<FNT name='Arial Narrow' size='5'><ITA><CLR red='104' green='104' blue='104'>" + [municipalities.NAME] + "</CLR></ITA></FNT>"
return label