ToRasterDataset |
|
Release 9.2
Last modified January 3, 2008 |
Print all topics in : "Conversion (Spatial Analyst)" |
Converts a feature dataset to a raster.
Usage tips
ArcObjects
Any shapefile containing point, line, or polygon features can be converted to a raster.
If the input item contains floating-point values, the output raster will be floating point. If the input item is integer, the output raster will be integer.
There can be no joins, descriptors, or z/m fields or settings.
ToRasterDataset is a complement to the ToFeatureData method, which converts a raster to a feature class.
ToRasterDataset can be used to convert raster formats. For example, it can be used to convert an ArcInfo GRID to a TIFF raster.
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. |
' 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")