*.dem Open in ArcGIS
Dem is often used in daily applications of data, to fill in the excavation analysis, three-dimensional scene display, image map of the correction, hydrological analysis and so on. As a result of projects or projects we need to buy some dem, where *.dem is the most common form of DEM, *.dem has two formats, NSDTF and USGS.
If it is the USGS format dem, it is very good to do. Can be read directly through ArcGIS. Usgs-dem (USGS is the United States Geological Survey (U). S. Geological Survey), is a public format of DEM data format standards, the use of a broader format. In Arctoolbox in ArcGIS, the transform tool-go to Grid-the DEM go to Grid tool directly transforms the USGS-formatted DEM into raster dem.
But we buy a lot of DEM is Nsdtf-dem format, Nsdtf-dem is the People's Republic of China National Standard Geospatial Data Interchange Format, is a grid data interchange format, the general GIS software does not support this format. Let's take a look at how to open this format dem in ArcGIS.
First, open *.dem with Notepad to analyze how the header file in this format is represented.
From top to bottom, look at what each row of values or code means:
M: Coordinate unit, K for kilometer, m for M, D
Represents the latitude and longitude in degrees, and s represents the latitude and longitude expressed by degrees.
0: Direction angle.
0: Compression method. 0 means no compression, and 1 represents run length encoding.
36212435.000000: Upper left corner x coordinate
3243120.000000: The upper-left corner of the origin y-coordinate
The spacing of the 5:x direction.
The spacing of the 5:y direction.
962: Number of lines
1252: Number of columns
100: Elevation of the value of the magnification
– The concrete grid value is followed, where-99999 indicates that the place is nodata.
Because raster cell data values are recorded in the same way, it is mainly the header file information is different. File headers such as the ArcGIS grid data record related information as follows:
Ncols
962
Nrows
1252
Xllcorner
36212435
Yllcorner
3243120
Cellsize
5
nodata_value-99999
If we change the header file in the NSDTF format above to Grid header file format, where the elevation value is unchanged, you can view the *.dem in ArcGIS. (It is best to change the suffix name to *.GRD.) After changing the header file, the file has become a grid file. By modifying this *dem header file, you can convert it directly to a GRD file.
If you have hundreds of DEM in NSDTF format, you may not be able to consider a single modified header file. We need to modify or use the Gdal Open Source Library in a program way.
.......................................................
Streamwriterstreamwriter = Newstreamwriter (Outfullname, false);
Streamwriter.writeline ("{0}
{1}
{2}
{3}
{4}
{5}
{6}
“,
int (rows), int (cols), extent. Upperleft.x,
Extent. Upperleft.y, Cellsize,-99999);
for (int i = 0; i < rows; i++)
{
For
(int j = 0; J <cols; J + +)
{
StreamWriter.Write ("{0}{1}", cells.) GetValue (J, Rows-1-i),
((j + 1)% 10 = 0)? ”
“ : ” “);
}
Streamwriter.writeline ();
}
StreamWriter.Close ();