加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

ESRI Grid format 及matlab的打开方法

(2012-10-19 17:09:51)
标签:

教育

分类: RS


 

 

Thanks to: http://hi.baidu.com/imheaventian/item/4f23e8b9556877eb4ec7fd10

ArcInfo ASCII Grid format(*.grd的ascii文件),Arc/Info Binary Grid format(.aux.adf....)


An Esri gridis a raster GIS file format developed by Esri, which has two formats:

proprietary binary format, also known as anARC/INFO GRID, ARC GRID and many other variations

Anon-proprietaryASCII format, also known as an ARC/INFO ASCII GRID


 Thebinary format is widely usedwithin Esri programs, such as ArcGIS, while theASCII format is used as an exchange, or export format, due to the simple and portable ASCII file structure.

The grid defines geographic space as an array of equally sized square grid points arranged in rows and columns.Each grid point stores a numeric value that represents a geographic attribute (such as elevation or surface slope) for that unit of space. Each grid cell is referenced by its x,y coordinate location.

 


ArcInfo ASCII Grid format

 

 

ArcInfo (formerly called ARC/INFOis a popular, commercial GIS package from ESRI Corp. ARC ASCIIGRID refers to a specifc ASCII format developed for ARC/INFOARC format consists of a header that specifies the geographic domain and resolution, followed by the actual grid cell values. ARC format grids are single-band files.

ARC ASCIIGRID refers to a specifc interchange format developed for ARC/INFO rasters in ASCII format.Usually the file extension is .asc, but recent versions of ESRI software also recognize the extension .grd. It looks like this:

ncols 157nrows 171xllcorner -156.08749650000yllcorner 18.870890200000cellsize 0.008333000 0 1 1 1 2 3 3 5 6 8 9 12 14 18 21 25 30 35 41 47 5359 66 73 79 86 92 97 102 106 109 112 113 113 113 111 109 106103 98 94 89 83 78 72 67 61 56 51 46 41 37 32 29 25 22 19etc...Records 1 - 6 Geographic header

Coordinates may be in decimal or integer format. DD:MM:SS format for geodetic coordinates is not supported.

ncols xxxxx

ncols refers to the number of columns in the grid and xxxxx is the numerical value

nrows xxxxx

nrows refers to the number of rows in the grid and xxxxx is the numerical value

xllcorner xxxxx

xllcorner refers to the western edge of the grid and xxxxx is the numerical value

yllcorner xxxxx

yllcorner refers to the southern edge of the grid and xxxxx is the numerical value

cellsize xxxxx

cellsize refers to the resolution of the grid and xxxxx is the numerical value

nodata_value xxxxx

nodata_value refers to the value that represents missing data and xxxxx is the numerical value.This is
optional and your parser should not assume it will be present. Note: that if you need a good value, the ESRI default is -9999.

Record 7 -> end of file Data values

These are the value of individual cell typically representing elevation of a particular area.

xxx xxx xxx

val(nox,noy) (f) = individual grid values, column varying fastest in integer format.Grid values are stored as integers but can be read as floating point values.

xllcorner and yllcorner are given as the EDGES of the grid, NOT the centers of the edge cells. ARC/INFO supports other header strings that allow the centers of the edge cells to be given using xllcenter and yllcenter instead. The origin of the grid is the upper left and terminus at the lower right.


 

 % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %

 

matlab怎样读取grd格式的图像数据并绘图使用arcgridread函数读入grd文件用mapshow函数绘制二维或三维等值线图arcgridread  Read a gridded data set in Arc ASCII Grid Format Syntax[Z,R] = arcgridread(filename) reads a grid from a file in Arc ASCII Grid format. Z is a 2-D array containing the data values. R is a referencing matrix (see makerefmat). NaN is assigned to elements of V corresponding to null data values in the grid file.

% 读入grd数据,利用arcgridread
[Z,R] = arcgridread('MtWashington-ft.grd');
% 利用mapshow显示地图数据
mapshow(Z,R,'DisplayType','surface');
% 标记
xlabel('x (easting in meters)'); 
ylabel('y (northing in meters)')
colormap(demcmap(Z))
% View the terrain in 3-D
axis normal; view(3); 
axis equal;
grid on
zlabel('elevation in feet')

注意:虽然surfer生成的也是grd文件,但是却是二进制文件,因此不能用上面的arcgridread函数打开。



 % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %


Arc/Info Binary Grid format

The Arc/Info Binary Grid format is the internal working format of the Arc/Info Grid product.It is also usable and creatable within the spatial analyst component of ArcView.It is a tiled format with run length compression capable of holding raster data of up to 4 byte integers or 4 byte floating data. 

This format should not be confused with the Arc/Info ASCII Grid format which is the interchange format for grids.Files can be converted between binary and ASCII format with the GRIDASCII and ASCIIGRID commands in Arc/Info.This format is also different than the flat binary raster output of the GRIDFLOAT command. The Arc/Info binary float, and ASCII formats are also accessable from within ArcView.

This format should also not be confused with what I know as ESRI BIL format. This is really a standard ESRI way of creating a header file (.HDR) describing the data layout a binary raster file containing raster data.


Version
I am not sure yet how the versions work for grid files. I have been working primarily with grid files generated by ArcView 3.x, and it's associated gridio API. The hdr.adf files I have examined start with the string GRID1.2 for what that's worth. Certainly the file naming conventions seem to follow the Arc/Info 7.x conventions rather than that of earlier versions.

File Set
A grid coverage actually consists of a number of files. A grid normally lives in it's own directory named after the grid. For instance, the grid nwgrd1 lives in the directory nwgrd1, and has the following component files:

-rwxr--r-- 1 warmerda users 32 Jan 22 16:07 nwgrd1/dblbnd.adf
-rwxr--r-- 1 warmerda users 308 Jan 22 16:07 nwgrd1/hdr.adf
-rwxr--r-- 1 warmerda users 32 Jan 22 16:07 nwgrd1/sta.adf
-rwxr--r-- 1 warmerda users 2048 Jan 22 16:07 nwgrd1/vat.adf
-rwxr--r-- 1 warmerda users 187228 Jan 22 16:07 nwgrd1/w001001.adf
-rwxr--r-- 1 warmerda users 6132 Jan 22 16:07 nwgrd1/w001001x.adf

Sometimes datasets will also include a prj.adf files containing the projection definition in the usual ESRI format. Grids also normally have associated tables in the info directory. This is beyond the scope of my discussion for now.
The files have the following roles: 

//范围、边界文件 (LLX, LLY, URX, URY表示左下角何右上角XY坐标)
dblbnd.adf: Contains the bounds (LLX, LLY, URX, URY) of the portion of utilized portion of the grid.

//头文件 header->hdr
hdr.adf: This is the header, and contains information on the tile sizes, and number of tiles in the dataset. It also contains assorted other information I have yet to identify.

//统计数据文件 (最大、最小值,平均值等)
sta.adf>: This contains raster statistics. In particular, the raster min, max, mean and standard deviation.

//属性表文件
vat.adf: This relates to the value attribute table. This is the table corresponding integer raster values with a set of attributes. I presume it is really just a pointer into info in a manner similar to the pat.adf file in a vector coverage, but I haven't investigated yet. 

//数据文件
w001001.adf: This is the file containing the actual raster data.  

//数据索引文件
w001001x.adf: This is an index file containing pointers to each of the tiles in the w001001.adf raster file.

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有