Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Conversion toolbox > To Raster toolset > Tools

ASCII To Raster (Conversion)

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

Print all topics in : "Tools"


Related Topics

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


Usage tips

Command line syntax
An overview of the Command Line window
ASCIIToRaster_conversion <in_ascii_file> <out_raster> {INTEGER | FLOAT}

Parameter Explanation Data Type
<in_ascii_file>

The input ASCII file to be converted.

File
<out_raster>

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 file format.

Raster Dataset
{INTEGER | FLOAT}

The data type of the output raster dataset.

  • INTEGER — An integer raster dataset will be created.
  • FLOAT — A floating-point raster dataset will be created.

String
Data types for geoprocessing tool parameters


Command line example

ASCIIToRaster d:\data\whitehorse.mdb\surveys.txt d:\Newdata.mdb\surveys.tif INTEGER

Scripting syntax
About getting started with writing geoprocessing scripts
ASCIIToRaster_conversion (in_ascii_file, out_raster, data_type)

Parameter Explanation Data Type
in_ascii_file (Required)

The input ASCII file to be converted.

File
out_raster (Required)

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 file format.

Raster Dataset
data_type (Optional)

The data type of the output raster dataset.

  • INTEGER — An integer raster dataset will be created.
  • FLOAT — A floating-point raster dataset will be created.

String

Data types for geoprocessing tool parameters


Script example

# ASCIIToRaster_sample.py
# Description: 
#   Converts an ASCII file representing raster data to a raster.
# Requirements: None
# Author: ESRI
# Date: Oct 20, 2005
# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InAsciiFile = "C:/data/raster2ascii.asc"
    OutRaster = "C:/data/raster1"

    # Process: ASCIIToRaster_conversion
    gp.ASCIIToRaster_conversion(InAsciiFile, OutRaster, "INTEGER")

except:
    # Print error message if an error occurs
    print gp.GetMessages()

Map Algebra syntax
See ASCIIGrid.

The Spatial Analyst extension must be present to use this link.

ArcObjects syntax
See ImportFromASCII.

The Spatial Analyst extension must be present to use this link.

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