Problem copying rasters into a file geodatabase

1789
10
Jump to solution
03-19-2018 09:07 AM
DanielSchatt
New Contributor III

hi, I'm just trying to copy TIF rasters into a file geodatabase that I create.  But the copied rasters in the new file geodatabase are corrupted.  The corrupted rasters have no cell size in the properties and no statistics and they show that default range of -3.4e+038 to 3.4e+038.  Calculating statistics on them gives an error. 

At first I thought the input list to the RasterToGeodatabase tool might be the problem but it looked looked fine (raster names separated by semicolons).  But even when I try to copy a single raster, it gets corrupted. 

This seems pretty straightforward, can't imagine what I'm doing wrong.  Thanks for any help...

import arcpy
from arcpy.sa import *
import datetime
arcpy.CheckOutExtension("Spatial")

todaysDateString = datetime.date.today().strftime("%Y%m%d")
out_folder_path = "Y:\\SCHISM_Data"
out_name = "SCHISM_Data_" + todaysDateString + "_test_FGDB_extractCode.gdb"

arcpy.CreateFileGDB_management(out_folder_path, out_name)

arcpy.env.workspace = "C:\\SCHISM_project\\output_test_FGDB"
rasterList = arcpy.ListRasters("*Con*")

rasterPathList = []
for eachRaster in rasterList:
   rasterPathList.append(eachRaster)

finalRasterPathList = (";".join((i for i in rasterPathList)))

arcpy.RasterToGeodatabase_conversion(finalRasterPathList, out_folder_path + "\\" + out_name)
0 Kudos
10 Replies
DanielSchatt
New Contributor III

The issue seems to have been with this particular machine, don't know if it was a memory issue maybe?.  I simply restarted and now that's working fine...just hope this is a one-off.  Thanks for your time Dan..