Tutorial of converting Dem terrain data to dat format supported by cass

1. Obtain dem data
. The dem elevation data download of various precisions will not go into details here. You can refer to my article on CSDN:
Elevation Data Download

Here we take the 12.5m precision dem as an example for conversion:

dem data download

2. Convert the dem data into text.
Here we first load the terrain data into globalmapper, and then select the output function in the file menu to convert the dem data into text form. Here we choose to export the elevation grid format:


Next, we choose the XYZ Grid format:


In the output configuration interface, we select "comma" as the separator:


Click OK and select the output path to complete the conversion.
3. Processing
the output result Since the output result is in .xyz format, we need to edit it if we want to actually convert it to dat format.
We first change the file to txt and drag it into wps or excel to open:


At this time, we use the column function to divide the data into columns:


Because we chose "comma" as the delimiter before, now we also choose "comma" as the delimiter:


Next, click Finish according to the default operation and the result is as shown in the figure:


4. Output the dat file in the format required by
CASS. Because the latitude and longitude coordinates in CASS and the latitude and longitude coordinates in CAD are reversed, we need to exchange the order of longitude and latitude. The result of the exchange is as follows:


Because of the format requirements in the data data, the first two rows need to be emptied here, and the serial numbers are arranged in the first row. For large amounts of data, here you can select the first column and fill the serial numbers in batches through the fill function:


The final table is as follows:


Next, we save the file as, because excel does not support direct output as dat format, we will output it as csv format first:


Then just change the suffix of csv to dat format:


The final result is as follows:

 

Guess you like

Origin blog.csdn.net/wanqiu1112/article/details/108659812