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.

  • What's the name of the program? Are you comfortable using Python if a driver doesn't exist?
    – mikewatt
    Commented Mar 23, 2020 at 20:07
  • @mikewatt It is a program made long ago as a student project, so it doesn't have any recognizable name. I am comfortable with python, what would you recommend?
    – Jake
    Commented Mar 23, 2020 at 20:11
  • It is similar to Esri ASCII grid format, which is supported by GDAL. But I think (not sure) that it can handle just square pixels. Commented Mar 23, 2020 at 21:03
  • Definitely look into the various ASCII drivers as @GabrielDeLuca suggests, maybe one of them is compatible as-is and you can simply leverage gdal_translate. Otherwise I suggest using 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.
    – mikewatt
    Commented Mar 23, 2020 at 21:27


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.