Converting DEM file types, and merging DEM files using QGIS 2.18

Discussion about RailWorks route design.

Converting DEM file types, and merging DEM files using QGIS 2.18

Unread postby BoostedFridge » Sat Mar 19, 2022 10:47 pm

The tutorial below is part of a much larger one (in process), encompassing the complete route creation process.

In this installment, we are going to cover the process of converting, or merging and converting .TIF DEM files, into .BIL DEM files for use with Redem, or BILxSRTM programs to make ready for use in Train Simulator/Railworks.

This tutorial will use the free and open source software QGIS. I have been using version 2.18 of that program for this process. While not the most current version of QGIS, 2.18 was the newest version before updates to the program made the process below more complicated. All of the historical versions of QGIS are available for download from their site at this link: https://qgis.org/downloads

Choose a 64bit version of the program if you are running a 64bit system. Download and run the setup program.

After installation is complete, open QGIS.

1. Click on 'Raster' in the menu bar.

2. Mouse over 'Miscellaneous' in the drop down menu.

3. Click on 'Merge' in that submenu.

(Click on any of the images below to enlarge them for easier reading)

1.jpg



This opens the 'Merge' pop up window. In this instance we are going to convert a single .TIF file into a .BIL file. This is the process to use if you are using 1 arc second DEM files for later conversion to the .HGT format to be directly imported into Railworks/Train Simulator. Repeat this process for each of the .TIF files needed for your route individually.

If you are using the program ReDEM (no longer available for download) to import DEM for your route, there is an addendum at the bottom of this tutorial to merge multiple .TIF files into a single .BIL file for speeding up the ReDEM process.

4. Click the 'Select' button next to 'Input Files'

2.jpg


This will open a popup window. In that window, navigate to the location of the .TIF file that you want to convert.

5. Click on the file to be converted.

6. Click 'Open'

3.jpg


This will return you to the 'Merge' menu. The file path of the.TIF file you selected will be in the 'Input Files' box.

7. Click the 'Select' button next to 'Output file'

4.jpg


8. Click on the file type drop down menu next to 'Save as type'

9. Scroll through that menu, then click on 'ESRI .hdr Labelled (.bil .BIL)'

5.jpg


(continued below)
You do not have the required permissions to view the files attached to this post.
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Re: Converting DEM file types, and merging DEM files using QGIS 2.18

Unread postby BoostedFridge » Sat Mar 19, 2022 10:49 pm

10. Name the output file. (I suggest maintaining the original files nomenclature if you are working on a route that will have multiple DEM files)

Ensure that 'ESRI .hdr Labelled (.bil .BIL)' is selected as the Save as Type.

11. Click 'Save'

6.jpg


This will bring you back to the 'Merge' window. Your input file should be loaded, as well as your output file type and name.

12. Press 'OK'

7.jpg


The conversion process will only take a few seconds for 1 arc second files. Higher resolution single files will take longer.

When the process is complete, a window named 'Finished' will pop up with 'Process Complete' displayed.

Press 'OK'

8.jpg


Navigate to the file location you specified for the Output File, and you should see your new .BIL file there. With it, you can continue through the Searchlight Simulations DEM tutorial, located at the bottom of my DEM download tutorial noted earlier: http://www.railworksamerica.com/forum/viewtopic.php?f=7&t=17791#p204307


For ReDEM users looking to merge multiple DEM files (.TIF format or otherwise) follow the steps below. These will be used in place of steps 4, 5, and 6 above.

(continued below)
You do not have the required permissions to view the files attached to this post.
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC

Re: Converting DEM file types, and merging DEM files using QGIS 2.18

Unread postby BoostedFridge » Sat Mar 19, 2022 10:59 pm

For ReDEM users looking to merge multiple DEM files (.TIF format or otherwise) follow the steps below. These will be used in place of steps 4, 5, and 6 above.

Having an organized folder structure for your DEM files during this process will help. Note in the example below that I have placed the three DEM files (.TIF format) that I am looking to merge in a single folder with no other files. I have named this folder '1 Folder TIF Merge'.

I have also created an additional folder named 'Merged BIL Output' where I will save the .BIL file and its associated files. This is especially useful for the ReDEM process, as you will have an extra step to perform, not covered in the posts above.

Merge folder setup.jpg


4a. Click the box beside 'Choose input directory instead of files'

4b. Click the 'Select' button beside 'Input Directory'

2a.jpg


5a. Navigate to the folder that you have your multiple files to merge located in

6a. Click 'Select Folder'

2b.jpg


You can now resume the process from the tutorial above at step 7. Note that the conversion process after step 12 will take much longer. When merging multiple high resolution DEM files the process can take several minutes, even on a high spec computer.
You do not have the required permissions to view the files attached to this post.
User avatar
BoostedFridge
 
Posts: 2277
Joined: Sat Aug 24, 2013 6:39 am
Location: Vancouver, BC


Return to Route Design

Who is online

Users browsing this forum: PetalBot and 1 guest