<?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 in Arcpy creates erroneous values? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584293#M45818</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;This post could go under a previous thread I started under the heading "Why does Python suck?", but want to start off fresh.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to reclassify NoData values to zero for two rasters that each have a single value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, os from arcpy.sa import * from arcpy import env arcpy.CheckOutExtension("Spatial") arcpy.env.overwriteOutput = True&amp;nbsp; ws = arcpy.env.workspace=r"X:\DATA\Raster_LC.gdb" arcpy.env.extent = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.mask = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.snapRaster = r"X:\DATA\Raster_LC.gdb\Study_Area_ras"&amp;nbsp; #####&amp;nbsp; Following section Converts nodata to 0 values within the extent of the above mask.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeAd = Reclassify("New_Trees", "Value", RemapValue ([["NODATA", 0], [700, 1000]])) TreeAd.save("Trees_Ad_0") TreeAd = "Trees_Ad_0" TreeErase = Reclassify("Remove_Trees", "Value", RemapValue ([["NODATA", 0], [100, 30]])) TreeErase.save("Tree_Erase_0") TreeErase = "Tree_Erase_0"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"New_Trees" is a single value raster (700) and "Remove_Trees" is a single value raster (100). I use the study area extent, mask, and snap raster to define the extent of my NoData conversion. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attribute tables: Should be ; Actually produced&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Trees_Ad_0": 0, 1000; 9, 1000 - Where does the 9 come from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Trees_Erase_0": 0, 30; 29, 30 - Where does the 29 come from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd love to know why this happens (has happened in the past), and &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I prevent this from happening?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many 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>Thu, 26 Apr 2012 16:25:39 GMT</pubDate>
    <dc:creator>RichardThurau</dc:creator>
    <dc:date>2012-04-26T16:25:39Z</dc:date>
    <item>
      <title>Reclassify in Arcpy creates erroneous values?</title>
      <link>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584293#M45818</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;This post could go under a previous thread I started under the heading "Why does Python suck?", but want to start off fresh.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to reclassify NoData values to zero for two rasters that each have a single value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, os from arcpy.sa import * from arcpy import env arcpy.CheckOutExtension("Spatial") arcpy.env.overwriteOutput = True&amp;nbsp; ws = arcpy.env.workspace=r"X:\DATA\Raster_LC.gdb" arcpy.env.extent = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.mask = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.snapRaster = r"X:\DATA\Raster_LC.gdb\Study_Area_ras"&amp;nbsp; #####&amp;nbsp; Following section Converts nodata to 0 values within the extent of the above mask.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeAd = Reclassify("New_Trees", "Value", RemapValue ([["NODATA", 0], [700, 1000]])) TreeAd.save("Trees_Ad_0") TreeAd = "Trees_Ad_0" TreeErase = Reclassify("Remove_Trees", "Value", RemapValue ([["NODATA", 0], [100, 30]])) TreeErase.save("Tree_Erase_0") TreeErase = "Tree_Erase_0"&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"New_Trees" is a single value raster (700) and "Remove_Trees" is a single value raster (100). I use the study area extent, mask, and snap raster to define the extent of my NoData conversion. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attribute tables: Should be ; Actually produced&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Trees_Ad_0": 0, 1000; 9, 1000 - Where does the 9 come from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"Trees_Erase_0": 0, 30; 29, 30 - Where does the 29 come from?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd love to know why this happens (has happened in the past), and &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I prevent this from happening?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many 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>Thu, 26 Apr 2012 16:25:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584293#M45818</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2012-04-26T16:25:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reclassify in Arcpy creates erroneous values?</title>
      <link>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584294#M45819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Rich,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that if you specify the NoDATA value last, you won't run into this issue.&amp;nbsp; Try the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy, os from arcpy.sa import * from arcpy import env arcpy.CheckOutExtension("Spatial") arcpy.env.overwriteOutput = True&amp;nbsp; ws = arcpy.env.workspace=r"X:\DATA\Raster_LC.gdb" arcpy.env.extent = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.mask = r"X:\DATA\Raster_LC.gdb\Study_Area_ras" arcpy.env.snapRaster = r"X:\DATA\Raster_LC.gdb\Study_Area_ras"&amp;nbsp; #####&amp;nbsp; Following section Converts nodata to 0 values within the extent of the above mask.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeAd = Reclassify("New_Trees", "Value", RemapValue ([[700, 1000], ["NODATA", 0]])) TreeAd.save("Trees_Ad_0") TreeAd = "Trees_Ad_0" TreeErase = Reclassify("Remove_Trees", "Value", RemapValue ([[100, 30], ["NODATA", 0]])) TreeErase.save("Tree_Erase_0") TreeErase = "Tree_Erase_0"&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2012 17:14:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584294#M45819</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-04-26T17:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reclassify in Arcpy creates erroneous values?</title>
      <link>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584295#M45820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jake, that did the trick. I am interested in the why, simply because if I had used these values in a combination with other values and set up a reclassify based on anticipated outputs, I would never have known this issue occurred. If this method always works, I'm not worried about it. But does reclassify ever deliver erroneous values even when NoData is last?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rich&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2012 18:35:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584295#M45820</guid>
      <dc:creator>RichardThurau</dc:creator>
      <dc:date>2012-04-26T18:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Reclassify in Arcpy creates erroneous values?</title>
      <link>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584296#M45821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was unable to get erroneous results when NoDATA was listed last.&amp;nbsp; I'm not sure if NoDATA has to be listed last by design, or if this is a bug.&amp;nbsp; If you like, you can follow up with this issue by logging an incident with Tech Support.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2012 19:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/reclassify-in-arcpy-creates-erroneous-values/m-p/584296#M45821</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-04-26T19:08:56Z</dc:date>
    </item>
  </channel>
</rss>

