I want to check that a particular features exists or not in getFeature().
Suppose in attribute table I have ID, Name, CAT, and Type columns. Now I want to check that CATEGORY column is exists or not in features.
I use this but this is not working.
for poi in layerPOI.getFeatures():
if "CATEGORY" in layerPOI.getFeatures():
and this as well. It producing keyError
if poi["CATEGORY"]#As category not exists it giving error here
ifstatement to see if the feature exists by matching it to an id or name. – Joseph Sep 30 '16 at 12:04if "CATEGORY" in layerPOI.getFeatures()again. – xunilk Sep 30 '16 at 12:14