Two main steps:
- Translate source data elevation to EGM2008
- Configure and run script "GenDEMCGL.py"
This step is necessary, because it is believed that the game uses elevation values relative to EGM2008 for the dem data. If translation is not done, absolute elevation values will be possibly tens of meters off.
This assumes you elevation data is in datum that uses wgs84 ellipsoid (for example epsg:4326).
Download egm08_25.gtx from http://download.osgeo.org/proj/vdatum/egm08_25/
and place it to
C:\OSGeo4W64\share\proj\
Edit elev_wgs84_egm2008.py
On line 5 srcpath
with path to your source files.
On line 6 dstpath
to destination folder.
On line 7 epsg
code of your source data, there will be no horizontal datum change, only elevations will be adjusted
Copy elev_wgs84_egm2008.py
to C:\OSGeo4W64\
Run OSGeo4W.bat
from that folder.
It will open a terminal window.
In that terminal, run
py3_env
python3 elev_wgs84_egm2008.py
In dstpath
there should be "undulated" files.
If you have multiple layers, do this from all of them.
Best way to manage large number of raster files in Global Mapper is to create a Map Catalog of them.
Save the catalog to same folder with source data.
In this view you can add add files to the catalog, or a folder, using buttons "Add Files" or "Add Directory". Click Add Directory.
Select folder that contains source files.
In this screen you could filter the files by file extension or partial name for example. Keep recurse on if the files are in subfolders.
Successfully added file(s) show in the Modify Map Catalog Window.
Loaded map can be seen in the main window.
If you have multiple layers, do this from all of them.
Open and edit GenDEMCGL.py
-
Edit Options
- DEM input files is a list of source data, that is corrected to EGM2008, all specified files will be loaded to Global Mapper. First item in the list will be at the bottom, and last item at the top. So input order should be from lowest quality to highest quality.
-Get UL and LR
Load All your source layers in Global Mapper and change projection to Geographic WGS84.
Note the UL and LR coordinates by hovering mouse over the point and writing down coordinates on the bottom of the window.
- Run the script
First ouput will be like:
Maximum space needed will be around 63037 MB
If padding tiles are not "full", it will be less
Showing quadkeys over source data in global mapper
When padding enabled, outermost tiles don't have to be completely covered
1/3 of width/height should be enough
Check if coverage is OK
On the first row it tells the estimated maximum disk space need for the project. Then an instance of Global Mapper will open and show an estimate like this: As padding is enabled, outermost tiles will not be built. So actual covered area will be area in this red rectangle:
As the coverage looks OK, we close Global Mapper and answer "y" to the question asked:
Everything OK? Continue? [Y/n]:y
Processing will then begin and there will be output to the console. This will take a considerable amount of time on large areas. This example project of 18 CGLs (and 22 padding tiles) took 50 minutes to build on a Ryzen 1700, 16gb of ram and nvme ssd.
Finally you should see:
Ready to fly folder morko-dem-finland-lvl12 is at
C:\Users\teemu\source\repos\MSFS2020_CGLTools\_temp
Just copy to Community to check if it works
And that's about that :)