This tutorial shows how to accomplish seamless merging of route modules with TransDEM and T:ANE.
This feature is core functionality of TransDEM for Trainz since version 1.2, when TransDEM began to write native Trainz route files. It's briefly described in the TransDEM Trainz manual, but occasionally, TransDEM users encounter difficulties here. An illustrated tutorial may help.
Note: This will only work, if the following conditions are met:
- Both route modules were created with TransDEM.
- Both route modules reside in the same UTM zone.
- Both route modules still have their World Origin objects exactly as positioned by TransDEM
- The DEM data source for both modules is of same or similar quality (e.g. by taking it from the same provider and the same series)
Geo data sources for this exampleIn this example we use
Canadian geo data.
Originally, I pointed directly to the Geogratis download-by-index addresses. Unfortunately, these download addresses tend to change. I therefore collected all geo data needed for this tutorial and put it into one place. Download the geo data for this and related tutorials here:
TutorialsCanadianGeoData.zip (56 MB)
Map sheet index is CTI-04_NTS-SNRC_Index_Prairies_300dpi_index.jpg. This is for orientation only.
For the tutorial we need the files at 082o03 and 082o04, for DEM, raster and vector map.
DEM source is CDED, 1:50,000. The 50K CDED DEMs always come as an eastern and western part. We merge them in TransDEM prior to any other action.
Raster data source is Toporama (for simplicity), 1:50,000.
Vector data is CanVec. The railway layer is named *_TR_1020009_1.shp.
First route module We begin with 082o03 and load DEM, raster and vector map (railway layer only for vector). We get something like this (DEM shading on, transparency 45%, shading intensity 35%)
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge01.jpg)
We export the entire map – no export mask – to Trainz with the following settings:
- Ground texture from raster map
- Show UTM grid
- Apply route filter for 7 baseboards (this is a mountainous area, and we want some depth.)
- Trainz version T:ANE
- No default fog
- Map name “082o03”
- Region “United States”
We also export the track, all default settings there.
We import the route with T:ANE CM and open it in Surveyor. We would normally start working on his route template now, but in this tutorial we are only interested in expanding further westward. Therefore we go to the western end of this route.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge02.jpg)
On the minimap we can identify the baseboard grid (black), the UTM grid (purple), the Trans Canada Highway, the railway, “Johnson Lake” and part of a label that ends with “cite”. These will be our clues for merging with the next route module. (We will try to avoid numeric coordinates in this tutorial as far as possible.)
Expansion route moduleTo expand our route westward we will create the route module 082o04. For this we load DEM, raster and vector map into TransDEM and get this:
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge03.jpg)
We zoom to the eastern border, but are not able to spot the other half of the label “cite”. We are missing some geo data here. This can be explained. While the geo data sources 083o03 and 082o04 will merge seamlessly for DEM and raster map – the border is -115° 30' for both – Trainz routes are constrained by the baseboard raster. And the baseboard raster is bound to UTM when working with TransDEM. As only entire baseboards can be exported we were one short when exporting 082o03.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge04.jpg)
To bridge the gap we merge 082o04 with 082o03 in TransDEM.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge05.jpg)
Since we already have 082o03 as a route module in Trainz, we only need one additional baseboard. We create a rectangular mask which should encompass all of 082o04. Again we zoom in to the eastern border of 082o04. This time we find “Johnson Lake” and the other part of our label which now forms “Anthracite”. Remember, we already have “cite” in Trainz, we only need “Anthra” as the extra and this is how to position the mask:
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge05a.jpg)
The entire export area will be this, as defined by the mask:
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge06.jpg)
We create a new Trainz route module with the same parameters as before and name it 082o04. We also export the tracks. We import this new route module with T:ANE Content Manager.
MergingIn Surveyor we open 082o03 again and will merge new 082o04 with it. (We could do it the other way round, only as long has both modules have proper TransDEM-placed World Origin objects. See
other tutorial, if that's no longer the case)
In Surveyor we open the Merge window and select 082o04 as the route to merge with.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge07.jpg)
In the background we identify 082o03. (It may take a while for Surveyor to paint all the baseboards.) In the foreground and mostly in red is 082o04. With the left arrow button we move 082o04 westward and also reposition the view.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge08.jpg)
Then we zoom in.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge09.jpg)
With the arrow buttons we position 082o04 to exactly match 082o03. We check the result by zooming in further. “Anthracite” has become a complete label. (The T:ANE Merge window shows us the baseboard grid for the existing module on the right, but not for he new module on the left.)
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge10.jpg)
To finish the merge we also have to merge the layers, one to one. After that we click the OK (checkmark) button.
We get this:
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge11.jpg)
Lets zoom in further:
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge12.jpg)
And change the viewing angle. There is a gap in the track and that's all we find. Remember, “cite” was in module 082o03 and “Anthra” in 082o04. There is no visible seam between the two. That's how it should be.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge13.jpg)
In Surveyor we save the merged route as 082o03-04.
Post-Processing the World Origin in TransDEM There is one last thing to do, but that is important. Merging in Surveyor butchers the World Origin, if there are two of them. It appears that the lat/long values in config.txt are retained from the original module (082o03 here), but the WO object itself is taken from the second module (082o04 in this example). This behaviour has been noticed since I started with TRS2004 many years ago and it never made sense. Therefore, TransDEM has a function to fix the WO. This is needed in case you want to modify the merged route in TransDEM, to add UTM tiles or vectors.
With T:ANE there is also a second problem with the World Origin. Surveyor may reset the lat/long values to the default for the region selected (United States in our example). Fortunately, there is a backup, the TransDEM info file. It also has the proper lat/long coordinates. TransDEM 2.6 tries to restore from there, if the config.grid values don't make sense. We open route 082o03-04 for editing in Content Manager. Note that the exported folder name becomes “kuid <uid> <oid> 082o03-04”. This is new in T:ANE.
We call the Repair WO function in TransDEM (under the Trainz menu) select the route, “kuid 126773 100036 082o03-04” in my case, and apply.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge14.jpg)
Message boxes will inform us about success or failure. Ours tell us, that TransDEM has restored the WO geographic coordinates from the info file and has relocated the WO object to baseboard [0,0]
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge15.jpg)
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge16.jpg)
In Content Manager we submit the edits.
World Origin object in the routeOne last check. Where actually is our WO? For this we open 082o03-04 in Surveyor again and navigate to the WO, via the Environment menu and the Location tab. The WO, as palced by TransDEM will always be in the precise centre of baseboard [0,0] with Trainz World Coordinates [360,360]. (The Find WO function in Surveyor travel 10m onward and sets the “look-at” position to [360,350]. (Don't feel confused by the coordinate reading. X is Northing, Y is Easting, and the Northing axis is inverted.)
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge17.jpg)
Zooming out in stages, we find that our WO resides in the 082o03 half, hiding up in the mountains. That's no surprise because 082o03 with the route filter applied has a bit of a crescent shape and TransDEM locates baseboard [0,0] close to the middle.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge18.jpg)
![Image](http://img.transdem.de/albums/userpics/10001/thumb_SeamlessMerge19.jpg)