<?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: Error 010240 - Cost Path Tool Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-010240-cost-path-tool-python/m-p/1123607#M63167</link>
    <description>&lt;P&gt;If this is an esri raster, your output path shouldn't contain spaces or punctuation and the output name is too long (10 chars max I think).&lt;/P&gt;&lt;P&gt;You would be better off saving to a *.tif by adding the file extension to the file name.&amp;nbsp; *.tif files are recommended by esri for most raster functions&lt;/P&gt;</description>
    <pubDate>Tue, 07 Dec 2021 21:28:04 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-12-07T21:28:04Z</dc:date>
    <item>
      <title>Error 010240 - Cost Path Tool Python</title>
      <link>https://community.esri.com/t5/python-questions/error-010240-cost-path-tool-python/m-p/1123525#M63164</link>
      <description>&lt;PRE&gt;&lt;SPAN&gt;Hi so I am trying to do a least-cost-path analysis using Arcpy and I am trying to save the Cost Path raster&lt;BR /&gt;but I keep getting this error with the final line of the cost path tool. If I take out the save portion I am able to&lt;BR /&gt;convert it to a polyline, but I need data from the result. I used model builder to develop the script and only made&lt;BR /&gt;minor changes to some of the file paths. Any help would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Error:&lt;BR /&gt;RuntimeError: ERROR 010240: Could not save raster dataset to C:\Users\doc34\Desktop\LCP_Project-20211206T164053Z-001\LCP_Project\CostPath_Raster with output format GRID.&lt;BR /&gt;&lt;BR /&gt;Code:&lt;BR /&gt;# Process: Cost Path (Cost Path) (sa)&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;CostPath_Raster = &lt;SPAN&gt;"C:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Users&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;doc34&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Desktop&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;LCP_Project-20211206T164053Z-001&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;LCP_Project&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;CostPath_Raster"&lt;BR /&gt;&lt;/SPAN&gt;cost_path = CostPath_Raster&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;CostPath_Raster = arcpy.sa.CostPath(&lt;SPAN&gt;in_destination_data&lt;/SPAN&gt;=Geological_Source&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;in_cost_distance_raster&lt;/SPAN&gt;=CostDis_DEM&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                                    &lt;SPAN&gt;in_cost_backlink_raster&lt;/SPAN&gt;=BackLink_DEM&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;path_type&lt;/SPAN&gt;=&lt;SPAN&gt;"EACH_CELL"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                                    &lt;SPAN&gt;destination_field&lt;/SPAN&gt;=&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;                                    &lt;SPAN&gt;force_flow_direction_convention&lt;/SPAN&gt;=&lt;SPAN&gt;"INPUT_RANGE"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;# the below code would save the cost-path raster, but throws an error that I have not been able to solve&lt;BR /&gt;&lt;/SPAN&gt;CostPath_Raster.save(cost_path)&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(&lt;SPAN&gt;"Cost Path Raster Complete"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 19:50:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-010240-cost-path-tool-python/m-p/1123525#M63164</guid>
      <dc:creator>NathanShelley</dc:creator>
      <dc:date>2021-12-07T19:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error 010240 - Cost Path Tool Python</title>
      <link>https://community.esri.com/t5/python-questions/error-010240-cost-path-tool-python/m-p/1123607#M63167</link>
      <description>&lt;P&gt;If this is an esri raster, your output path shouldn't contain spaces or punctuation and the output name is too long (10 chars max I think).&lt;/P&gt;&lt;P&gt;You would be better off saving to a *.tif by adding the file extension to the file name.&amp;nbsp; *.tif files are recommended by esri for most raster functions&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 21:28:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-010240-cost-path-tool-python/m-p/1123607#M63167</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-07T21:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error 010240 - Cost Path Tool Python</title>
      <link>https://community.esri.com/t5/python-questions/error-010240-cost-path-tool-python/m-p/1123959#M63179</link>
      <description>&lt;P&gt;Yep I changed:&lt;/P&gt;&lt;PRE&gt;CP = &lt;SPAN&gt;"C:&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Users&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;doc34&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;Desktop&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;LCP_Project-20211206T164053Z-001&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;LCP_Project&lt;/SPAN&gt;&lt;SPAN&gt;\\&lt;/SPAN&gt;&lt;SPAN&gt;CostPath_raster"&lt;BR /&gt;to&lt;BR /&gt;CP = "C:\\Users\\doc34\\Desktop\\LCP_Project-20211206T164053Z-001\\LCP_Project\\CPR"&lt;BR /&gt;and it worked!&lt;BR /&gt;Thank you&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 18:55:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-010240-cost-path-tool-python/m-p/1123959#M63179</guid>
      <dc:creator>NathanShelley</dc:creator>
      <dc:date>2021-12-08T18:55:12Z</dc:date>
    </item>
  </channel>
</rss>

