Select to view content in your preferred language

python label expression to determine label minThreshold

351
1
02-15-2024 11:28 AM
cweirpatrickco
Occasional Contributor

I'm looking to create a python label expression that sets the labels minimum threshold (out beyond) value according to the [Shape__Area] field value.

So far I have this (which works):

 

def FindLabel ( [UNIT_NAME], [Shape__Area] ):
  if float([Shape__Area]) >= 228202:
    return [UNIT_NAME]

 

 
This currently leaves out all labels for features that don't meet the condition. I'd like to still include those features but just have their labels appear at a different out beyond value...

So, something along the lines of:

 

def FindLabel ( [UNIT_NAME], [Shape__Area] ):
  if float([Shape__Area]) >= 228202:
      set.minThreshold()
    return [UNIT_NAME]

 


Is this possible?

0 Kudos
1 Reply
cweirpatrickco
Occasional Contributor

workaround: I created a separate label class and adjusted the labels out beyond value to 1:35,000 for features that meet the condition below

 

 

def FindLabel ( [UNIT_NAME], [Shape__Area] ):
    if float([Shape__Area]) <= 228202:
      return [UNIT_NAME]

 

 

 
I'm still interested to know if you can adjust label min/maxThresholds from a label expression!

0 Kudos