Reclassify remap to Old Value?

594
2
04-10-2012 09:51 AM
RichardThurau
Occasional Contributor
Hi,
I'm trying to prep some vector layers for combining as rasters. I've set an attribute in each vector to match the raster value i want them to have. I am converting the vectors, in a list, to raster.

Then, i want to recalssify my rasters, in a list, so that the old value remains the same, but all NoData cells within a mask are converted to zero (a necessary step because Arc defaults the intersection of raster extents for output).

I can do this layer by layer no problem. But, if I want to run my reclassify on a list of rasters, I'd want something like:

RasList = ListRasters("", "")
for ras in RasList:
    Reclassify(ras, "Value", RemapValue([[OldValue, OldValue], ["NODATA", 0]]))


Is there a way to either skip the old values while at the same time adding zeros for NoData?

Thanks

Rich
Tags (2)
0 Kudos
2 Replies
JeffBarrette
Esri Regular Contributor
I'm not sure how to do it at 10.0 but at 10.1 we've added a new RasterClassifiedSymbology class to the arcpy.mapping module.  Check out the beta help at:

http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#/RasterClassifiedSymbology/00s30000005p...

I hope this will help,
Jeff
0 Kudos
RichardThurau
Occasional Contributor
Jeff,
Thanks for the reply. I'm thinking this does not help me, even if i was on 10.1.

Seems that a getValue for rasters would do the job.

RasList = ListRasters("", "")
for ras in RasList:
    arcpy.UpdateCursor(ras)
    val = row.getValue(row[0])
    Reclassify(ras, "Value", RemapValue([[val, val], ["NODATA", 0]]))


There are a couple hypotheticals in this code I'm not sure about: 1. Don't know if you can slice the row function in an update cursory. 2. Not sure the get value (val) will be read inside of the reclassify dialogue.
Hopefully I'll have time to try this out today. I will post results, because I know the Community is itching to know!

Thanks Jeff for the inspiration.

RT
0 Kudos