Loading DEM files and trimming for export to Trainz
With the maps downloaded and the route traced, the next step is to bring in the DEMs and trim them to the map area. DEMs are huge files now, done in 1-degree slices of the earth, and sometimes require more than one segment of map to cover the area we need. The problem is the DEMs themselves are quite huge and need to be trimmed down to cover the area we actually want to represent because neither TD nor T:ANE can handle multiple full sized DEMs in one shot, and TS12 barfs when trying to import insanely huge routes. As a test I brought in a 750MB TD route into T:ANE without a hitch. TS12 CM crashed immediately to the desktop! Keep in mind that this maybe the upper end of the route size as this was never tested further from here.
Using our map as a guide and route as an anchor we will trim the DEMs in sections and butt them up against each other to build one contiguous subsection of the map.
For this process you will need to unzip the DEM files.
All you will need to use, out of the huge download is one file - the largest of the .img files in the zip.
Open the Zip and drag out the largest .img and place that in your route folder in your TransDEM data folders you have setup - the same folder where all the images have downloaded to. Once copied we need to bring in one DEM at a time to trim down and save.
With your map still loaded up on the screen:
- Click on File/DEM and choose Open DEM.
You should see it in the same list as you have just placed it in the same folder.
It can take time to load up each DEM individually so let it do its thing and don't panic. You can see the progress bar at the bottom of the TD screen which shows how much is being imported.
- When importing, click OK on the defaults displayed there is no need to touch anything here so just ignore them.
When the DEM loads up, it will be green and other colors which represent the lows and highs. Your map area will cover a small portion of all this map, perhaps only a snot-sized slice which has happened to me more than once.
Our next steps now involve trimming, saving, loading, and merging together to create the final result.
- Click on the single white arrow - the Select Tool.
- Click on the DEM/map image and draw a box around your map that sits on that section of the DEM just up to the edge where it ends on the DEM its self. It doesn't matter if you draw above that into the black area - just the green part and map are selected.
- Click on the Scissor to Erase DEM points.
- Click OUTSIDE the selected map area.
A dialog box will appear with ALL OUTSIDE selected.
- Click OK to trim everything down to just your MAP with that section of the DEM.
If you make a mistake, you can always start again - we haven't saved anything just yet.
- If all is OKAY, save the DEM by clicking on File/DEM, and choosing Save DEM as... and put in a name. I call mine Part A or Part 1, etc.
- Repeat this with each section. Open DEM, choose the next one, trim, and Save. You will be prompted about closing the existing DEM. Just click on OK.
Once all the DEMs have been trimmed down, we now merge all the pieces back together into one smaller DEM that just covers your route.
- Close all DEMs by clicking on File/DEM close DEM.
- With no DEMs showing, click on Open DEM and choose Part A or Part 1, depending upon how you saved them.
- Once that part loads up, repeat with the next part and choose Add DEM, and then the next until all the DEMs are loaded up.
It may take time to load up each of the DEM files.
- Once loaded up, if you are satisfied with your trimming and splicing, you can now save this DEM as a single DEM. I usually call mine Final for lack of any other name.
By this point, your route should be plotted out. This is the actual route that will become the rail line that we'll use to generate the Trainz route. Your images should be in place. If you have downloaded multiple times, ensure that they are all loaded up. You can actually save these as one group. By the time I'm done, I may have had to download multiple sets because of missed map images. I ran into this recently with a new map I'm working on. I saved the final map concatenation as large.lgb even though there are many map images00x.lgb files in there.
- Close all the Raster Images.
- Open your saved and trimmed DEM
I actually import the DEM first then load the map images later. At any rate, ensure the whole package is complete and together so you see your blue route line on the maps and DEM.
Exporting to Trainz
- Click on Trainz on the top menu bar.
- Click on Export and Create DEM and Ground Textures.
Now we need to fill in some blanks.
Starting on the left:
- Skip down to Route filter.
- Apply the filter to at least 4 baseboards. You can go higher if you want, or less. This is the number of baseboards that will be cut back when we export the route. You don't have to do this at all and you can do the trimming later in Trainz. It's up to you.
Trainz Version:
- Pick T:ANE for T:ANE or TS12 for TS12. Use T:ANE for TRS19 and above.
- You'll see an option for 5 meter grid. You can apply that to only the baseboards where the route actually is traced, and leave the rest at a lower resolution. You'll find this helpful when you have lots of mountains because you don't need a high resolution outside the area. In fact it's good for all routes. Then if you're gutsy, you can pick All and build a gazillion 5m baseboards.
Middle Section right top:
Skip over the very top with UTM coordinates and go to Overlay Bitmap (Ground Texture).
- Check Ground Texture from Raster Map (important to show your Topo map!)
- Uncheck show route. You don't want to have the route's blue line hiding yards and stuff.
- Uncheck UTM grid. Unless you are using 3d Tiles (don't ask), or Google Earth tiles, this is not helpful and obliterates images on the map.
Go down to Map KUID:
- Put in your UID then the starting number.
- Check Search all World\Custom\Maps for unique KUID
- Check Reuse existing KUID
Going down to the bottommost section the Export Destination:
Put in the path for your exported routes.
E:\TransDEM_Data\Route Export
- Below that goes your map name. Put in your route name up to 15 chars.
- Click OK.
That's it, your route is being built. It can take some time to do this and let it finish. I usually go do something else while it builds up the route.
After everything is cooked down and your route is exported
- Start up T:ANE, or TS12
- Go to Content Manager
- Open up Windows Explorer
- Open up the folder where you exported your routes to.
- Drag that new route into CM.
- After it's imported successfully, open up in T:ANE/TS12 and have a look.
If there's anything you don't like, delete the route from Trainz, and delete the exported route (not the original). Rebuild things again, adjust the settings, maybe you need some more maps, etc.
Build a new one and have a look.
Exporting routes in sections
Due to the sheer size of the data, it is sometimes necessary to trim back the route into smaller segments and import as smaller routes that can be merged in Trainz. Since TransDEM uses UTM coordinates, a route which has been cut into sections can be assembled together as long as the edges have not been altered in Trainz.
To split a route in TransDEM:
- Load up the DEM and the tile raster map.
- Ensure that show grids is on and displays the UTM coordinates.
- Write down, the coordinates for the map slice based on the UTM coordinates. Note: these are kept in a text file which will be in the route-export folder. If you neglect to write down the information, you can always view it there
- Using the Simple Route Editor, trace the route as outlined above.
- Using the Marquee Tool, select the area around the drawn route. This will lock the area as a selected.
- Using the Scissors, click on the outside area to trim out what you do not want. A dialog box will come up with this option selected.
- Export the route as normal, saving the name you wish to use.
- Close the DEM
- Close the Raster Map
- DO NOT SAVE THE TRIMMED MAP
- Open the Raster Map
- Open DEM
- Repeat again for the next section. You can determine the exact location to start from by referring to the coordinates which are exported from the previous section.