<?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: raster.save gives RuntimeError: ERROR 010240 in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/raster-save-gives-runtimeerror-error-010240/m-p/1325047#M72710</link>
    <description>&lt;P&gt;I have further tried to investigate and when I move my .tif file way up in working directory CopyRaster function is working:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CopyRaster_management&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;"c:\scratch\delta_t_veg_temp.tif"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;"c:&lt;/SPAN&gt;&lt;SPAN&gt;\c&lt;/SPAN&gt;&lt;SPAN&gt;lip.gdb&lt;/SPAN&gt;&lt;SPAN&gt;\x&lt;/SPAN&gt;&lt;SPAN&gt;xx"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there any way to overcome this issue? I am creating a Python tool that should be part of the ArcGIS Desktop project and will be run on different machines by different users.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you!&lt;BR /&gt;Best from&amp;nbsp;&lt;BR /&gt;Tadeas&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 02 Sep 2023 07:51:13 GMT</pubDate>
    <dc:creator>TadeášDěd</dc:creator>
    <dc:date>2023-09-02T07:51:13Z</dc:date>
    <item>
      <title>raster.save gives RuntimeError: ERROR 010240</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/raster-save-gives-runtimeerror-error-010240/m-p/1325046#M72709</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running simple code:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;from arcpy.sa import Raster&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;arcpy.CheckOutExtension("Spatial")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;print("Creating delta_t_veg raster...")&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;d2 = Raster(D2_VEG) &amp;nbsp;# Replace with the actual path to your raster&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;d1 = Raster(D1_VEG) &amp;nbsp;# Replace with the actual path to your raster&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;delta_t = d2 - d1&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;scratch_save_path = f"&lt;SPAN&gt;delta_t_veg_new &lt;/SPAN&gt;"&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;delta_t.save(scratch_save_path)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and it returns an error:&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: ERROR 010240: Could not save raster dataset to delta_t_veg_new with output format FGDBR.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;When I first save the raster to tif and then trying to upload it to gdb with&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;arcpy.CopyRaster_management(scratch_save_path, final_save_path)&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;I get:&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;arcgisscripting.ExecuteError: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (&lt;A title="" target="_blank"&gt;http://esriurl.com/support&lt;/A&gt;) to Report a Bug, and refer to the error help for potential solutions or workarounds. General function failure No spatial reference exists. Failed to execute (CopyRaster).&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;I have double-checked paths, I have tried shorter paths for gdb, the workspace is set to my gdb, and&amp;nbsp;&lt;SPAN&gt;delta_t&lt;/SPAN&gt;&amp;nbsp;is legit (I can save it to .tif to disk).&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help? It seems like a path issue, are raster tools sensitive to paths on Windows? When running raster calculator in ArcGIS Desktop it is working. When running above code in notebook, it is not....&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 07:42:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/raster-save-gives-runtimeerror-error-010240/m-p/1325046#M72709</guid>
      <dc:creator>TadeášDěd</dc:creator>
      <dc:date>2023-09-02T07:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: raster.save gives RuntimeError: ERROR 010240</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/raster-save-gives-runtimeerror-error-010240/m-p/1325047#M72710</link>
      <description>&lt;P&gt;I have further tried to investigate and when I move my .tif file way up in working directory CopyRaster function is working:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;arcpy&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;CopyRaster_management&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;"c:\scratch\delta_t_veg_temp.tif"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;r&lt;/SPAN&gt;&lt;SPAN&gt;"c:&lt;/SPAN&gt;&lt;SPAN&gt;\c&lt;/SPAN&gt;&lt;SPAN&gt;lip.gdb&lt;/SPAN&gt;&lt;SPAN&gt;\x&lt;/SPAN&gt;&lt;SPAN&gt;xx"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is there any way to overcome this issue? I am creating a Python tool that should be part of the ArcGIS Desktop project and will be run on different machines by different users.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you!&lt;BR /&gt;Best from&amp;nbsp;&lt;BR /&gt;Tadeas&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 02 Sep 2023 07:51:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/raster-save-gives-runtimeerror-error-010240/m-p/1325047#M72710</guid>
      <dc:creator>TadeášDěd</dc:creator>
      <dc:date>2023-09-02T07:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: raster.save gives RuntimeError: ERROR 010240</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/raster-save-gives-runtimeerror-error-010240/m-p/1325049#M72712</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;after further investigation, the problem was caused by underscore in the name of save raster. I.e. changing&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;scratch_save_path = f"&lt;SPAN&gt;delta_t_veg_new&lt;/SPAN&gt;" to&amp;nbsp;scratch_save_path = f"&lt;SPAN&gt;deltaTVegNew&lt;/SPAN&gt;" solved the issue. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;I think this is a kind of bug, which should be fixed ...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;BR /&gt;TD&lt;/P&gt;</description>
      <pubDate>Sat, 02 Sep 2023 08:50:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/raster-save-gives-runtimeerror-error-010240/m-p/1325049#M72712</guid>
      <dc:creator>TadeášDěd</dc:creator>
      <dc:date>2023-09-02T08:50:33Z</dc:date>
    </item>
  </channel>
</rss>

