Hi,
I'm trying to clean up my classification by reclassifying clumps that are surrounded by a class as that class, for instance, building candidates.
I've had no problems calculating the relative border which produces a column with decimals.
However, using this new column to populate the appropriate column is showing an error:
algorithm20160214.py:160: RuntimeWarning: invalid value encountered in greater
mod_buildings = numpy.where((rel_bor > 0.50), "building_candidate".encode(), mod_buildings)
The relevent bit of code is below:
rastergis.calcRelBorder("pleiades_segs.kea", "rel_bor", "Modern", "building_candidate", False)
rel_bor = rat.readColumn(ratDataset, "rel_bor")
mod_buildings = rat.readColumn(ratDataset, "Modern")
mod_buildings = numpy.where((rel_bor > 0.50), "building_candidate".encode(), mod_buildings)
I've checked using tuiview that there are clumps that match this, so that doesn't seem to be the problem.
In addition, I ran the same code specifying:
numpy.where((mod_buildings == "building_candidate".encode()), "building_candidate".encode(), mod_buildings)
This worked fine.
I suspect it has something to do with the column format but I'm a little confused as I've had no problems with my other RAT columns.
Many Thanks
William