5.0

5.0 | 1 rating Rate this file 10 Downloads (last 30 days) File Size: 2.81 KB File ID: #24442

Save ascii raster

by Giuliano Langella

 

15 Jun 2009 (Updated 02 Feb 2010)

Save a MatLab array in a typical ArcInfo ascii raster, with header at top.

| Watch this File

File Information
Description

This function saves a spatial matrix into an Arc-Info ascii raster. Two file extension '.asc' or '.txt' are supported.

FIRST CASE
USE: SaveAsciiRaster(varname, header);
It requires two inputs: (1) the z-values to be exported ('varname' variable), and (2) the 'header' vector with the spatial information of the grid. 'varname' can be a 1-D vector or a 2-D spatial grid.

SECOND CASE
USE: SaveAsciiRaster(varname);
If an xyz matrix (with [x_coord,y_coord,z_values]) is given as 'varname', no 'header' has to be defined, since the function will extract all the required header information from the xyz table. The first row contains the x_coord, y_coord and z_value of the most north-western cell; the last row refers to the most south-eastern pixel. Elements in xyz are sorted column-by-column from the geographical grid (geographical_grid=[1st_col,2nd_col,3rd_col,...,last_col]; xyz=[1st_col;2nd_col;3rd_col;...;last_col]).
The xy coordinates have to refer to the center of the cells.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
26 Apr 2010 Miga Magenika Julian

in which line if i want to save the ascii files manually not automatic? because i want to put a header information in many data.

thank you

26 Apr 2010 Giuliano Langella

Line 69: uiputfile

Please login to add a comment or rating.
Updates
02 Feb 2010

An xyz matrix can now be saved using
SaveAsciiRaster(xyz);

Tag Activity for this File
Tag Applied By Date/Time
ascii raster export save grid header Giuliano Langella 15 Jun 2009 11:31:16
arc Giuliano Langella 15 Jun 2009 12:10:31
info Giuliano Langella 15 Jun 2009 12:10:31
gis Giuliano Langella 15 Jun 2009 12:10:31
ascii Giuliano Langella 02 Feb 2010 09:23:59
raster Giuliano Langella 02 Feb 2010 09:23:59
export Giuliano Langella 02 Feb 2010 09:23:59
save Giuliano Langella 02 Feb 2010 09:24:00
grid Giuliano Langella 02 Feb 2010 09:24:00
xyz Giuliano Langella 02 Feb 2010 09:24:00
header Giuliano Langella 02 Feb 2010 09:24:00
arc Karl 09 Feb 2010 15:06:00

Contact us at files@mathworks.com