Select to view content in your preferred language

ReclassByASCIIFile - Specify attribute/column in raster to use for reclass

779
4
05-16-2014 01:24 AM
MatthewBarlow
Emerging Contributor
Does anybody know how to specify the field name in the raster I am trying to reclass? I have a raster that I would like to reclassify using an ascii file that is generated via code. The reclass works fine, however it always uses the VALUE column in my raster. I need it to use a column that I created called FUNCTION.

Otherwise, I can use ReclassByTable, but I am not sure of the format of the file. I can't find any examples online about what the format of the reclass table would be if it is a text file and likewise how to specify which column in the raster to use for the reclass.

My other option is to ensure the VALUE column in my raster contains the values I want reclassed. However, this is generated from a shapefile and carries the FUNCTION column with it. Any way to repopulate the value column with the values I want reclassed?

Many thanks in advance. This is driving me crazy!
0 Kudos
4 Replies
DuncanHornby
MVP Notable Contributor
Look for the section "Using reclassification tables" in the Help file.
0 Kudos
MatthewBarlow
Emerging Contributor
Look for the section "Using reclassification tables" in the Help file.


I'm sorry, but I have... hence why I am here. The help section doesn't discuss how to specify the field on which to base the reclass, as far as I can see.
0 Kudos
DuncanHornby
MVP Notable Contributor
It seems the only tool that allows you to select the field to reclassify in the raster is the Reclassify tool. If you look at the interface it allows you to load previously saved remaps but it appears to save them out as info tables.

So...

Looks like you'll have to do this using python. Look at the help page on the reclassify tool, this shows an example. It would not be too hard to read your ascii file into the remap table object.
0 Kudos
curtvprice
MVP Alum
For most tools the only way to access another field in the raster table is to use the Lookup tool. Using the Lookup and Reclassify one after the other, or nesting the tools in Raster Calculator may be the best approach, depending on your workflow.
0 Kudos