Raster To Geodatabase (Conversion)

Summary

Loads multiple raster datasets into a geodatabase or raster catalog.

If this tool is used to load raster datasets into a raster catalog, then you need to run the Calculate Default Spatial Grid Index tool after the loading is completed.

Usage

Syntax

RasterToGeodatabase_conversion (Input_Rasters, Output_Geodatabase, {Configuration_Keyword})
ParameterExplanationData Type
Input_Rasters
[Input_Rasters,...]

Input raster dataset(s).

Raster Dataset
Output_Geodatabase

Either the path and name of a geodatabase or the path and name of a raster catalog.

Workspace ; Raster Catalog
Configuration_Keyword
(Optional)

Specifies the storage parameters (configuration) for a file geodatabase and an ArcSDE geodatabase. Personal geodatabases do not use configuration keywords.

ArcSDE configuration keywords are set up by your database administrator.

String

Code Sample

RasterToGeodatabase example (Python window)

This is a Python sample for RasterToGeodatabase.

import arcpy
from arcpy import env
env.workspace = "c:/data"
arcpy.RasterToGeodatabase_conversion("test.tif;test2.tif;test3.tif",\
                                     "c:/data/ToGDB.gdb/catalog")
RasterToGeodatabase example 2 (stand-alone script)

This is a Python script sample for RasterToGeodatabase.

##=========================
##Raster To Geodatabase
##Usage: RasterToGeodatabase_conversion Input_Rasters;Input_Rasters... Output_Geodatabase {Configuration_Keyword}
try:
    import arcpy
    arcpy.env.workspace = r"\\MyMachine\PrjWorkspace\RasGP"
    ##Convert Multiple Raster Dataset to FGDB
    arcpy.RasterToGeodatabase_conversion("ToGDB.mdb\\test;test.tif","ToGDB.gdb","MAX_FILE_SIZE_4GB")
    ##Load Raster Catalog
    arcpy.RasterToGeodatabase_conversion("test.tif;test2.tif;test3.tif","ToGDB.gdb\\catalog")
except:
    print "Raster To Geodatabase exsample failed."
    print arcpy.GetMessages()

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

11/14/2011