I have a program that can visualize terrain/elevation data but will only recognize files in the below format. It has the extension .map
but it is not recognized by QGIS or GDAL so I believe it may be another form of data.
When opened in a text file, it appears like this:
Example Map
XScale: 8.455
YScale: 10.447
XOrigin: 606319.184
YOrigin: 4056521.23
NumberOfCols: 91
NumberOfRows: 73
RangeUpper: 68.81
RangeLower: 30
0057.70 0058.18 0058.73 0059.29 0059.78 0060.18 0060.51 0060.81 0061.14 0061.46 0061.71 0061.81 0061.73 0061.52 0061.26 0061.07 0060.98 0060.98 0061.03 "...
The strings of data go on and on. Can anyone identify this format?
Would like to be able to convert to this from other elevation data types: GeoTIFF, DEM.
rasterio
rather than the GDAL bindings. 1) Parse the header into a dict, 2) use that shape info to initialize an empty numpy array, 3) read the file line-by-line and insert the values into the array, 4) create a transform using the header info +rasterio.transform.from_origin()
, 4) use rasterio to open a file and write out the array. If you get stuck post up your code and we can take a look.