Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Conversion (Spatial Analyst)

ToRasterDataset

Release 9.2
Last modified January 3, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Conversion (Spatial Analyst)"


Related Topics

Converts a feature dataset to a raster.


Usage tips

Command line syntax
See Feature to Raster or Raster to Other Format

Scripting syntax
See Feature to Raster or Raster to Other Format

Map Algebra syntax
See ShapeGrid

ArcObjects syntax
IRasterConversionOp::ToRasterDataset (dataset As IGeoDataset, rasterFormat As String, pWorkspace As IWorkspace, name As String) As IRasterDataset

Parameter Explanation
dataset Input feature class, feature class descriptor, or feature layer to be converted to a raster.
rasterFormat ESRI GRID, ERDAS IMAGINE, or TIFF formats are supported. The strings for outRasterFormat are GRID, IMAGINE Image, and TIFF respectively. They are case sensitive.
The format string GRID creates an output ESRI GRID with no file extension.
The format string TIFF creates a TIFF file with a .tif extension. ArcGIS also supports the TIFF format with .tiff and .tff extensions. A format string TIF creates a TIFF file with a .tiff extension, and a format string TFF creates a TIFF file with a .tff extension.
The format string IMAGINE Image creates a raster output with a .img file extension.
pWorkspace An object specifying the directory or subdirectory that will contain the output raster dataset.
name The name of the output raster dataset.

ArcObjects example

' Convert feature data to raster
' Member of esriGeoAnalyst.IConversionOp
'
' Function ToRasterDataset(ByVal dataset As esriGeoDatabase.IGeoDataset, _
'    ByVal rasterFormat As String, ByVal pWorkspace As esriGeoDatabase.IWorkspace, _
'    ByVal name As String) As esriGeoDatabase.IRasterDataset

Dim pConversionOp As IConversionOp
Set pConversionOp = New RasterConversionOp

Dim pFC01 As IFeatureClass
Set pFC01 = getFCfromDiskFunction("c:\data\myShape.shp")

' Create RasterDescriptor
Dim pFDesc As IFeatureClassDescriptor
Set pFDesc = New FeatureClassDescriptor
pFDesc.Create pFC01, Nothing, "species"

Dim pRasWS As IRasterWorkspace

Dim pRasout As IRasterDataset  
Set pRasout = pConversionOp.ToRasterDataset(pFDesc, "IMAGINE Image", pRasWS, "output.img")

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.