Hello,
if I use the following python script to create a fgdb with a raster dataset this works, but the raster dataset remains empty. So the command arcpy.WorkspaceToRasterDataset_management doesn't do anything. There's no error message.
import arcpy
from arcpy import env
arcpy.env.overwriteOutput = True
RasterCatalog_gdb = arcpy.GetParameterAsText(0)
PfadFGDB = arcpy.GetParameterAsText(1)
Dataset = arcpy.GetParameterAsText(2)
PfadWorkspace = arcpy.GetParameterAsText(3)
RasterGdb = PfadFGDB + "/" + RasterCatalog_gdb + ".gdb"
arcpy.AddMessage(RasterGdb)
DatasetPfad = PfadFGDB + "/" + RasterCatalog_gdb + ".gdb" + "/" + Dataset
arcpy.AddMessage(DatasetPfad)
try:
arcpy.CreateFileGDB_management(PfadFGDB, RasterCatalog_gdb, "CURRENT")
arcpy.CreateRasterDataset_management(RasterGdb, Dataset, "0,2", "8_BIT_UNSIGNED", "PROJCS['DHDN_3_Degree_Gauss_Zone_3',GEOGCS['GCS_Deutsches_Hauptdreiecksnetz',DATUM['D_Deutsches_Hauptdreiecksnetz',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Gauss_Kruger'],PARAMETER['False_Easting',3500000.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',9.0],PARAMETER['Scale_Factor',1.0],PARAMETER['Latitude_Of_Origin',0.0],UNIT['Meter',1.0]]", "3", "", "PYRAMIDS -1 NEAREST LZ77 75 NO_SKIP", "128 128", "LZ77", "")
arcpy.env.pyramid = "PYRAMIDS 3 BILINEAR JPEG"
arcpy.env.rasterStatistics = "STATISTICS 4 6 (0)"
arcpy.BuildPyramidsAndStatistics_management(PfadWorkspace, "INCLUDE_SUBDIRECTORIES", "BUILD_PYRAMIDS", "CALCULATE_STATISTICS")
arcpy.WorkspaceToRasterDataset_management(PfadWorkspace, DatasetPfad, "NONE", "LAST", "MATCH", "", "", "NONE", "0", "HISTOGRAM_MATCHING", "NONE")
except:
print "failed"
print arcpy.GetMessages()
Could it be that the dataset definition don't fit with the type of raster source files?
Dataset:
Raster Source file (jpeg):
I don't find any differences.
Or is it something with the calculation of statistics?
If I use the toolbox tools to load the data manually into the dataset, there's as well no error message and there's afterwards the same empty dataset although the tool message ends with a sucessful loading of the data.