I'm trying to save filled raster object to geo database by my specified filename.
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = r"C:\GIS Data\Cameron_Run\Topo_NED\Projected"
# Set local variables
surfaceRaster = "raw_10m_dem"
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute FlowDirection
fillRaster = Fill(surfaceRaster)
arcpy.RasterToGeodatabase_conversion(fillRaster, r"C:\GIS Data\Cameron_Run\Topo_NED
\Projected\fillRasterGDB.gdb")
But this code is saving raster file by its own specified name, for this case Fill_raw_10m1 is the default name of saved raster file.
Is there any way so that I can specify the name of saved raster file?
RasterToGeodatabase? – Alex Markov May 22 '12 at 13:12RasterToGeodatabase_conversiondoesn't provide any option to save as your specified name. You can only specify the output geo database path – user May 22 '12 at 13:15os.rename()) before runningRasterToGeodatabase_conversion. You can also use Rename tool from ArcToolbox. – Alex Markov May 22 '12 at 13:19