AnsweredAssumed Answered

Problem copying rasters into a file geodatabase

Question asked by dschatt on Mar 19, 2018
Latest reply on Mar 20, 2018 by Dan_Patterson

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 import *
import datetime

todaysDateString ="%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:

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

arcpy.RasterToGeodatabase_conversion(finalRasterPathList, out_folder_path + "\\" + out_name)