<?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: ClassifyRaster() Function not working in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857951#M4099</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, it was just a copying issue. Should have been &lt;BR /&gt;ecd_file = r"&amp;lt;path&amp;gt;\Preview_Segmented_TrainIsoCl.ecd"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Oct 2020 01:17:32 GMT</pubDate>
    <dc:creator>KarenSchulz</dc:creator>
    <dc:date>2020-10-14T01:17:32Z</dc:date>
    <item>
      <title>ClassifyRaster() Function not working</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857949#M4097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The function&lt;/P&gt;&lt;PRE style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 14px; display: block; padding: 1px 0px; margin: 0px; line-height: inherit; color: #000000; word-break: break-all; overflow-wrap: break-word; background-color: #ffffff; border: 0px; border-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;"&gt;arcpy.sa.Functions.ClassifyRaster(in_raster, in_classifier_definition, in_additional_raster='#')&lt;/PRE&gt;&lt;P&gt;is giving me the error &lt;SPAN class="" style="box-sizing: border-box; color: #b22b31; font-weight: bold;"&gt;RuntimeError&lt;/SPAN&gt;: Object: Error in executing tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I set up the example analogue to &lt;A class="link-titled" href="https://desktop.arcgis.com/de/arcmap/10.3/tools/spatial-analyst-toolbox/classify-raster.htm" title="https://desktop.arcgis.com/de/arcmap/10.3/tools/spatial-analyst-toolbox/classify-raster.htm"&gt;Raster klassifizieren—Hilfe | ArcGIS for Desktop&lt;/A&gt; .&lt;/P&gt;&lt;P&gt;You can see the code in the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcgis&lt;BR /&gt;from arcgis.gis import GIS&lt;BR /&gt;from arcgis.raster import Raster&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy.sa import *&lt;/P&gt;&lt;P&gt;from arcgis.raster.functions import *&lt;BR /&gt;from arcgis.raster.analytics import *&lt;/P&gt;&lt;P&gt;arcpy.CheckOutExtension("Spatial")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;file_path = r"&amp;lt;path&amp;gt;.tif"&lt;BR /&gt;raster_test = Raster(file_path)&lt;/P&gt;&lt;P&gt;test_img = segment_mean_shift(raster_test, spectral_detail=None, spatial_detail=None, spectral_radius=None, spatial_radius=None, min_num_pixels_per_segment=None)&lt;/P&gt;&lt;P&gt;# file generated through graphical interface, because python code is not working as well&lt;/P&gt;&lt;P&gt;ecd_file = f"&amp;lt;path&amp;gt;/Preview_Segmented_TrainIsoCl.ecd"&lt;/P&gt;&lt;P&gt;ClassifyRaster(in_raster=test_img, in_classifier_definition=ecd_file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate any help in solving this issue &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2020 11:17:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857949#M4097</guid>
      <dc:creator>KarenSchulz</dc:creator>
      <dc:date>2020-10-12T11:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: ClassifyRaster() Function not working</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857950#M4098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;ecd_file = f"&amp;lt;path&amp;gt;/....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;did you mean&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;ecd_file = r"&amp;lt;path&amp;gt;/...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;or was the 'f' instead of the 'r' a copy issue?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2020 16:37:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857950#M4098</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-10-12T16:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: ClassifyRaster() Function not working</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857951#M4099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, it was just a copying issue. Should have been &lt;BR /&gt;ecd_file = r"&amp;lt;path&amp;gt;\Preview_Segmented_TrainIsoCl.ecd"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2020 01:17:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857951#M4099</guid>
      <dc:creator>KarenSchulz</dc:creator>
      <dc:date>2020-10-14T01:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: ClassifyRaster() Function not working</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857952#M4100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/classify-raster.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/classify-raster.htm"&gt;Classify Raster (Spatial Analyst)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;# file generated through graphical interface, because python code is not working as well&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Not sure what you mean by that, but the warning in the help suggests something appears to be wrong with the inputs in a big way and I can't tell from your code (not sure what all the imports are needed for given the code examples in the help files)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #4c4c4c; background-color: #ffffff; margin-top: 0px; margin-bottom: 1.55rem;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;.ecd&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;file contains all the information needed to perform a specific type of Esri-supported classification. The inputs to this tool must match the inputs used to generate the required&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;.ecd&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;file.&lt;/P&gt;&lt;P style="color: #4c4c4c; background-color: #ffffff; margin-top: 0px; margin-bottom: 1.55rem;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class=""&gt;.ecd&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;file can be generated from any of the classifier training tools, such as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A class="" href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/train-random-trees-classifier.htm" style="color: #0074b8; text-decoration: none;"&gt;Train Random Trees Classifier&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A class="" href="https://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/train-support-vector-machine-classifier.htm" style="color: #0074b8; text-decoration: none;"&gt;Train Support Vector Machine Classifier&lt;/A&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2020 01:49:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/classifyraster-function-not-working/m-p/857952#M4100</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-10-14T01:49:02Z</dc:date>
    </item>
  </channel>
</rss>

