<?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 Re: Change raster values? in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/change-raster-values/m-p/626350#M35409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Rachel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can do this using the Con tool as you suspected.&amp;nbsp; Here is an example on how to iterate through rasters in a directory and change all values less than 1 in each raster to a value of 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy from arcpy import env env.workspace = r"C:\temp\python"&amp;nbsp; arcpy.CheckOutExtension("spatial")&amp;nbsp; for raster in arcpy.ListRasters("*"): &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.Con_sa(raster, "0", raster + "_con.tif", raster, '"VALUE" &amp;lt; 1')&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Sep 2013 18:12:00 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2013-09-23T18:12:00Z</dc:date>
    <item>
      <title>Change raster values?</title>
      <link>https://community.esri.com/t5/data-management-questions/change-raster-values/m-p/626349#M35408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have several raster's in which I need to change a group of values to 0, and I need to keep all other values the same. I know that I could use the reclassify tool, but its not practical in this instance where the list of the remaining values in very long and using the reclassify tool would require ALL values in the raster to be recoded. I'm wondering if maybe there's a conditional statement I could construct in the raster calculator?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Sep 2013 18:06:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/change-raster-values/m-p/626349#M35408</guid>
      <dc:creator>RachelAlbritton</dc:creator>
      <dc:date>2013-09-22T18:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Change raster values?</title>
      <link>https://community.esri.com/t5/data-management-questions/change-raster-values/m-p/626350#M35409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Rachel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can do this using the Con tool as you suspected.&amp;nbsp; Here is an example on how to iterate through rasters in a directory and change all values less than 1 in each raster to a value of 0:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy from arcpy import env env.workspace = r"C:\temp\python"&amp;nbsp; arcpy.CheckOutExtension("spatial")&amp;nbsp; for raster in arcpy.ListRasters("*"): &amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.gp.Con_sa(raster, "0", raster + "_con.tif", raster, '"VALUE" &amp;lt; 1')&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2013 18:12:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/change-raster-values/m-p/626350#M35409</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-09-23T18:12:00Z</dc:date>
    </item>
  </channel>
</rss>

