Raster to ASCII (Conversion)

License Level:BasicStandardAdvanced

Summary

Converts a raster dataset to an ASCII text file representing raster data.

Usage

Syntax

RasterToASCII_conversion (in_raster, out_ascii_file)
ParameterExplanationData Type
in_raster

The input raster dataset.

The raster can be integer or floating-point type.

Raster Layer
out_ascii_file

The output ASCII raster file.

File

Code Sample

RasterToASCII example (Python window)

Converts a raster dataset to an ASCII file representing raster data.

import arcpy
from arcpy import env
env.workspace = "c:/data"
arcpy.RasterToASCII_conversion("elevation", "c:/output/sa500.asc")
RasterToASCII example (stand-alone script)

Converts a raster dataset to an ASCII file representing raster data.

# Name: RasterToASCII_Ex_02.py
# Description: Converts a raster dataset to an ASCII file representing 
#    raster data. 
# Requirements: None

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
inRaster = "elevation"
outASCII = "c:/output/elevation.asc"

# Execute RasterToASCII
arcpy.RasterToASCII_conversion(inRaster, outASCII)

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Yes
ArcGIS for Desktop Standard: Yes
ArcGIS for Desktop Advanced: Yes
3/3/2014