I want to calculate the entropy index for landuses classes for an area based on a 100m Polygon Grid. I did find an existing toolbox that does all the required calculation. Input features are the 100m Polygon Grid and the landuse layer. However, since water bodies need to be removed from the landuse layer, the program runs into valueError for Grid cells that have entirely been filled with water and where no single landuse class is left for calculation. The valueError mentiones that the the Grid cell with this ID could not be found in the list even though it does exist in the attribute table in ArcMap. I am pretty sure that the error occurs in this piece of code
#Erase water bodies from landuse#-------------------------------gp.addmessage("Erase water bodies from landuse")query=str(lufld)+"'"+str(val_w)+"'"gp.select_analysis(inlu_w, inlu, query)and that Grid cells that only contain water bodies should maybe receive a foo instead to have at least one value. Anyway, I do not have any experience with arcpy and no idea how to do this, so I would grateful for any suggestions.
Thanks,Jan
أكثر...
#Erase water bodies from landuse#-------------------------------gp.addmessage("Erase water bodies from landuse")query=str(lufld)+"'"+str(val_w)+"'"gp.select_analysis(inlu_w, inlu, query)and that Grid cells that only contain water bodies should maybe receive a foo instead to have at least one value. Anyway, I do not have any experience with arcpy and no idea how to do this, so I would grateful for any suggestions.
Thanks,Jan
أكثر...