I'm creating a model that queries the number of features in a feature class and runs one of two scripts depending on if the feature class is empty or not.
I'm using Get Count to calculate the number of features with the output being 'Feature Count'
I then have two calculate values 'Policy Detected' and 'No Policy Detected' both set to Boolean data types
Policy detected is:
FeatureCount(%Feature Count%) def FeatureCount(n): if n> 0: return True else: return False
No Policy Detected is:
FeatureCount(%Feature Count%) def FeatureCount(n): if n >0: return False else: return True
When there are features in the feature class (n>0), 'Policy detected' has a 'True' output and 'No Policy detected has a 'False' output - all correct!
When there are no features in the featureclass (n=0) then both 'Policy detected' and 'No Policy detected' show a False output instead of 'False and 'True'
Any ideas what's wrong?