关于Arc/Info ASCII Grid 格式写入的问题
想将dem数据写入Arc/Info ASCII Grid 格式,我是直按照文件格式说明写入,只是没有加空格和换行,fopen(file,“wb”),可是写出来软件不识别,请高手指点一下,谢谢!
格式说明:
Records 1 - 6
Geographic header in ARC ASCIIGRID format:
*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.
Coordinates may be in decimal or integer format. DD:MM:SS format for geodetic coordinates is not supported.
Record 7 -> end of file
The following is an example ARC/INFO ASCIIGRID data file.
ncols 157
nrows 171
xllcorner -156.08749650000
yllcorner 18.870890200000
cellsize 0.00833300
0 0 1 1 1 2 3 3 5 6 8 9 12 14 18 21 25 30 35 41 47 53
59 66 73 79 86 92 97 102 106 109 112 113 113 113 111 109 106
103 98 94 89 83 78 72 67 61 56 51 46 41 37 32 29 25 22 19