ASCII To Raster (Conversion Tools)
Summary
Converts an ASCII file representing raster data to a raster dataset.
Legacy:
This is a deprecated tool. The Copy Raster tool can now be used to convert an ASCII file representing raster data to a raster dataset.
If you are using the browse button
text box on the Copy Raster tool, and the input file does not have an .asc extension, you can either rename the file to include that extension, or you can change the filter on the Input Raster dialog box from All Supported Types to Files. Renaming the file is the recommended option.
Usage
The input file is an ASCII-formatted text file.
The structure of the ASCII file consists of header information containing a set of keywords, followed by cell values in row-major order.
There are two variations of the structure of the ASCII file. One identifies the origin by the coordinates of the lower left corner of the lower left cell, the other as the center of the lower left cell.
The format of the file in general is:
NCOLS xxx NROWS xxx XLLCORNER xxx YLLCORNER xxx CELLSIZE xxx NODATA_VALUE xxx row 1 row 2 . . row nThe definitions of the keywords are as follows:
NCOLSandNROWSare the number of columns and rows in the raster defined by the ASCII file.XLLCORNERandYLLCORNERare the coordinates of the lower left corner of the lower left cell.You can also use
XLLCENTERandYLLCENTERto specify the origin by the coordinates of the center of the lower left cell.CELLSIZEis the cell size of the raster.NODATA_VALUEis the value that is to represent NoData cells.Cell values should be delimited by spaces. No carriage returns are necessary at the end of each row in the ASCII file. The number of columns in the header is used to determine when a new row begins.
An example of an ASCII raster file is:
NCOLS 480 NROWS 450 XLLCORNER 378922 YLLCORNER 4072345 CELLSIZE 30 NODATA_VALUE -32768 43 2 45 7 3 56 2 5 23 65 34 6 32 54 57 34 35 45 65 34 2 6 78 4 2 6 89 3 2 7 45 23 5 ...NODATA_VALUEis the value in the ASCII file that will be assigned to NoData cells in the output raster. This value is typically reserved for those cells with true values that are unknown. When the output raster is created, a system-generated NoData value will be used in place ofNODATA_VALUE.The number of cell values contained in the file must be equal to the number of rows multiplied by the number of columns; otherwise, an error will be returned.
The output data type can be either float or integer.
Once the output raster has been created, use the Define Projection tool to give it the appropriate coordinate system.
Parameters
| Label | Explanation | Data type |
|---|---|---|
|
Input ASCII raster file |
The input ASCII file to be converted. |
File |
|
Output raster |
The output raster dataset to be created. If the output raster will not be saved to a geodatabase, specify |
Raster Dataset |
|
Output data type (Optional) |
Specifies the data type of the output raster dataset.
|
String |
Environments
Auto Commit, Compression, Current Workspace, Output CONFIG Keyword, Pyramid, Raster Statistics, Scratch Workspace, Tile Size
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes