<?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: Problem copying TIF rasters into a file geodatabase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problem-copying-tif-rasters-into-a-file/m-p/545609#M42551</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;...&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;something to do with the larger Python script locking on to the TIF rasters&lt;/SPAN&gt;...&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you reversed the order by creating the geodatabase first, before processing any of the tiff files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Mar 2018 21:20:27 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-03-21T21:20:27Z</dc:date>
    <item>
      <title>Problem copying TIF rasters into a file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/problem-copying-tif-rasters-into-a-file/m-p/545608#M42550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is basically a repost of a previous question.&amp;nbsp; I thought I resolved it but I did not.&lt;/P&gt;&lt;P&gt;In one large script, I am generating a floating point TIF raster through a couple of raster operations.&amp;nbsp; I do this multiple times to generate multiple TIF floating point rasters.&amp;nbsp; I then create a file geodatabase and try to copy these TIF rasters into that file geodatabase with RasterToGeodatabase. &amp;nbsp; Basically the output rasters are becoming the input of the RasterToGeodatabase.&amp;nbsp; But the copied rasters in the file geodatabase are corrupted - no cell size or extent or range, and nothing is displayed. .&lt;/P&gt;&lt;P&gt;If I close and re-open the Python session and just create the file geodatabase and use the RasterToGeodatabase command (without running the whole script), those TIF rasters copy just fine into the file geodatabase.&lt;/P&gt;&lt;P&gt;So I'm thinking it has something to do with the larger Python script locking on to the TIF rasters that were just created in the script, so I can't operate on them.&amp;nbsp; Thanks for any help..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;outFilePath &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/SCHISM_project/output_test_FGDB"&lt;/SPAN&gt;
outFile &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Final_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; rasterTimeString &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".tif"&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# Generate final rasters by mosaicing rasters and then Con to extract non-zero values&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MosaicToNewRaster_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rastersListString&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outFilePath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; outFile&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; "&lt;SPAN class="comment token"&gt;#", "32_BIT_FLOAT", "#", "1", "LAST", "FIRST")&lt;/SPAN&gt;
testMosaic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Raster&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outFilePath &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; outFile&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
testMosaicCon &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Con&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;testMosaic &lt;SPAN class="operator token"&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; testMosaic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
testMosaicCon&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;save&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"C:/SCHISM_project/output_test_FGDB/Final_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; rasterTimeString &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"_Con.tif"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&lt;SPAN class="comment token"&gt;# Create file geodatabase&lt;/SPAN&gt;
todaysDateString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; datetime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;date&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;today&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strftime&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"%Y%m%d"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
out_folder_path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Y:/SCHISM_Data"&lt;/SPAN&gt;
out_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SCHISM_Data_"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; todaysDateString &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;".gdb"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateFileGDB_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;out_folder_path&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# Create list of rasters&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/SCHISM_project/output_test_FGDB"&lt;/SPAN&gt;
rasterList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"*Con*"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

rasterPathList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; eachRaster &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasterList&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; rasterPathList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;eachRaster&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

finalRasterPathList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;";"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;i &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasterPathList&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;


&lt;SPAN class="comment token"&gt;# Copy final rasters into file geodatabase on mobjack..."&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RasterToGeodatabase_conversion&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;finalRasterPathList&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; out_folder_path &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"/"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; out_name&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:36:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-copying-tif-rasters-into-a-file/m-p/545608#M42550</guid>
      <dc:creator>DanielSchatt</dc:creator>
      <dc:date>2021-12-11T23:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem copying TIF rasters into a file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/problem-copying-tif-rasters-into-a-file/m-p/545609#M42551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;...&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt;something to do with the larger Python script locking on to the TIF rasters&lt;/SPAN&gt;...&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you reversed the order by creating the geodatabase first, before processing any of the tiff files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2018 21:20:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problem-copying-tif-rasters-into-a-file/m-p/545609#M42551</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-03-21T21:20:27Z</dc:date>
    </item>
  </channel>
</rss>

