the SAS Hangar > Stainless' new Flight Simulator

Terrain height map generator for slibenli

(1/6) > >>

Stainless:
As requested I am writing a new tool, this thread will be the documentation for it and hold the download link when it is finished.

So here we go....


1) Boot up the app.  It's windows wpf



2) The first time you run the app you need to set the directory you want to store all the SRTM data. So Options SRTM Directory
 You can either type in the directory or use the browse button.
 Note, WPF does not have a folder browser dialog, so I cheated and used the save file dialog.



3) Create a new project.
    You can either fill in the fields by hand or you can use the pick location button



The pick button will open a new window and display google maps.

Click on the map where you want the top left of the IL2 map to be. You will see the latitude and longitude popup in a little window.



Click on the latitude and longitude.



Then cut and paste the coordinates into the text boxes.



4) Save your project!!!

 The download can take a very long time, so save the project. The download will resume from where it left off as long as you delete any bad zip files.



5) Start the map generation. Actions Generate Map

The display will change and show a list of SRTM files needed for the project. Now SRTM files do not exist for areas of the world that are totally ocean, so some files will never be downloaded. Don't worry about it.
If the zip file already exists on the disk, it won't download it again.
If the download times out, it will retry. It will retry a lot. Hence saving your project is a good idea.
Once all the zip files are downloaded, the app will extract the contents into the directory.
 


Now the app will work through all the SRTM files loading in the height map data to form a virtual height map much bigger than IL2 can handle

SRTM data uses -32768 as a special value which means "we don't have any data for this region", so I scan all the data and if I find this value I sample a 3 by 3 area around it and put an average value in this data point.

Then it builds the requested image as signed 16 bit values in metres.

It have put a simple screen in so you know it hasn't crashed.



Finally it creates a false colour image to show you the region covered by the map.



I had to do this as most terrain we are interested in is a lot lower than 5000m , and hence damn near black.

You are then free to save the generated height map from the action menu.

I have PNG , TGA , and also IL2 format.

I.E. The height is mapped to 0-255 using the height equation used by IL2. This is basically you map_h


Created a repository for it.

https://github.com/PaulBlythe/IL2Tools

slibenli:
Thank you for doing this!

There is one possible problem.
You're using wpf, which means the app will probably not run in linux (which I use for developing - actually I currently don't have a working windows installation). So I would need to setup a vm.
The question is whether that would be more productive (in the long run, as I would need to keep that vm running and updated - all drawing system resources) than porting the gui code to some other framework (which I would do, if you gave me the source).

BTW: I tried to load a 16000*16000 px height map in il2ge - unsuccessfully. At least for now the maximum size is 8000*8000 px.

Stainless:
Linux..... man I have 7 machines set up here and the only one that runs Linux is the raspberry pi  :)

I work in C# for tools because you have so much already done for you.

Multithreading TrivialParrallel programmingTrivialUser interface TrivialCollectionsTrivialImage loadingTrivial
The list just goes on.

To convert this to Linux is a major task.

Let me think about what I can do. I have a laptop here I don't need, but it has a Swedish keyboard....

slibenli:
C# as such shouldn't be a problem, as long as you don't use Windows-only stuff like Windows Forms or WPF.
I figure that the amount of GUI-specific code in the tool is relatively small(?)
With porting to another framework I meant porting that GUI-specific code to another (C# based) framework, like Qml.Net (https://qmlnet.github.io/introduction/) for example.

Hmm, I'll google what Swedish keyboard looks like ;)
Edit: OK it's a qwerty layout - that's good for me :)



Stainless:
This is the map saved as an IL2 map_h file


Navigation

[0] Message Index

[#] Next page

Go to full version