<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Reclassify remap to Old Value? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/reclassify-remap-to-old-value/m-p/605623#M47358</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;RasList = ListRasters("", "")
for ras in RasList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; Reclassify(ras, "Value", RemapValue([[OldValue, OldValue], ["NODATA", 0]]))&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to either skip the old values while at the same time adding zeros for NoData?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Apr 2012 16:51:35 GMT</pubDate>
    <dc:creator>RichardThurau</dc:creator>
    <dc:date>2012-04-10T16:51:35Z</dc:date>
    <item>
      <title>Reclassify remap to Old Value?</title>
      <link>https://community.esri.com/t5/python-questions/reclassify-remap-to-old-value/m-p/605623#M47358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;RasList = ListRasters("", "")
for ras in RasList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; Reclassify(ras, "Value", RemapValue([[OldValue, OldValue], ["NODATA", 0]]))&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to either skip the old values while at the same time adding zeros for NoData?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 16:51:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify-remap-to-old-value/m-p/605623#M47358</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2012-04-10T16:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Reclassify remap to Old Value?</title>
      <link>https://community.esri.com/t5/python-questions/reclassify-remap-to-old-value/m-p/605624#M47359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&amp;nbsp; Check out the beta help at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#/RasterClassifiedSymbology/00s30000005p000000/"&gt;http://resourcesbeta.arcgis.com/en/help/main/10.1/index.html#/RasterClassifiedSymbology/00s30000005p000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this will help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2012 15:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify-remap-to-old-value/m-p/605624#M47359</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2012-04-11T15:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reclassify remap to Old Value?</title>
      <link>https://community.esri.com/t5/python-questions/reclassify-remap-to-old-value/m-p/605625#M47360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply. I'm thinking this does not help me, even if i was on 10.1. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems that a getValue for rasters would do the job. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;RasList = ListRasters("", "")
for ras in RasList:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.UpdateCursor(ras)
&amp;nbsp;&amp;nbsp;&amp;nbsp; val = row.getValue(row[0])
&amp;nbsp;&amp;nbsp;&amp;nbsp; Reclassify(ras, "Value", RemapValue([[val, val], ["NODATA", 0]]))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully I'll have time to try this out today. I will post results, because I know the Community is itching to know!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Jeff for the inspiration.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RT&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:57:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify-remap-to-old-value/m-p/605625#M47360</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2021-12-12T01:57:54Z</dc:date>
    </item>
  </channel>
</rss>

