DEM to Raster (Conversion)


Converts a digital elevation model (DEM) in a United States Geological Survey (USGS) format to a raster dataset.

Learn about how DEM to Raster tool works



DEMToRaster_conversion (in_dem_file, out_raster, {data_type}, {z_factor})
ParameterExplanationData Type

The input USGS DEM file. The DEM must be standard USGS 7.5 minute, 1 degree, or any other file in the USGS DEM format. The DEM may be in either fixed or variable record-length format.


The output raster dataset to be created.

When not saving to a geodatabase, specify .tif for a TIFF file format, .img for an ERDAS IMAGINE file format, or no extension for a GRID raster format.

Raster Dataset

Data type of the output raster dataset.

  • INTEGERAn integer raster dataset will be created.
  • FLOATA floating-point raster dataset will be created. This is the default.

The number of ground x,y units in one surface Z-unit.

The Z-factor adjusts the units of measure for the Z-units when they are different from the x,y units of the input surface. The Z-values of the input surface are multiplied by the Z-factor when calculating the final output surface. If the x,y units and Z-units are in the same units of measure, the Z-factor is 1. This is the default. If the x,y units and Z-units are in different units of measure, the Z-factor must be set to the appropriate factor, or the results will be incorrect. For example, if your Z-units are feet, and your x,y units are meters, you would use a Z-factor of 0.3048 to convert your Z-units from feet to meters (1 foot = 0.3048 meters).


Code Sample

DEMToRaster example 1 (Python window)

Converts a USGS DEM to a raster dataset.

import arcpy
arcpy.DEMToRaster_conversion("c:/data/fixed.dem", "c:/output/fixeddem.tif", 
                             "FLOAT", 1)
DEMToRaster example 2 (stand-alone script)

Converts a USGS DEM to a raster dataset.

# Name:
# Description: Converts a USGS DEM file to a raster dataset. 
# Requirements: None

# Import system modules
import arcpy

# Set local variables
inDEM = "c:/data/fixed.dem"
outRaster = "c:/output/fixeddem.tif"
rasterType = "FLOAT"
zFactor = 0.30488

# Execute DEMToRaster
arcpy.DEMToRaster_conversion(inDEM, outRaster, rasterType, zFactor)


Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes