I'm trying to reclassify the pixel values of NLCD_2011 data to a binary representation of developed vs. undeveloped land.
import arcpy arcpy.CheckOutExtension("Spatial") nlcd = ('file path for the layer file') binary_landcover = ('destination file path') remap_value = "RemapValue([[11,0],[12,1],[21,0],[22,0],[23,0],[24,0],[31,1],[41,1],[42,1],[43,1],[51,1],[52,1],[71,1],[72,1],[73,1],[74,1],[81,1],[90,1],[95,1]])" # 11 Open Water # 12 Perennial Ice/Snow # 21 Developed, Open Space $ # 22 Developed, Low Intensity $ # 23 Developed, Medium Intensity $ # 24 Developed, High Intensity $ # 31 Barren Land # 41 Deciduous Forest * # 42 Evergreen Forest * # 43 Mixed Forest * # 52 Shrub/Scrub # 71 Grassland/Herbaceous ** # 81 Pasture Hay ** # 82 Cultivated Crops *** # 90 Woody Wetlands 000 # 95 Emergent Herbaceous Wetlands 000 #temp2 = Reclassify(nlcd, "VALUE", remap_value, 'NODATA') #temp2.save(binary_landcover) arcpy.gp.Reclassify_sa(nlcd, 'VALUE', remap_value, binary_landcover, "NODATA")
I've tried doing this, in python, using the 'Map Algebra' method, which ESRI documentation seems to deem preferable, and by just calling up the reclassify function. With both approaches the same thing happens, the function runs as expected, but when I load the output, it seems like the actual pixel values aren't changed. The only difference I can see is that the only remaining field is the field I targeted for remapping.
I tried doing the same thing in ArcMap, and it worked successfully.
I can't figure where I am going wrong trying to recreate my successful manual execution of the task in python.