This tutorial explains how to convert between UTM and Trainz internal baseboard coordinates for TransDEM based routes.
Note: For every day work it is quite unlikely that you ever need to refer to this coordinate conversion. Introduction TransDEM is designed to hide most of the math under the surface to make it easy to use. In this tutorial, however, we will deliberately dig a bit deeper and actually apply formulas, still very simple ones, just addition and subtraction. For the mathematician they belong to coordinate transformation and define a so-called “translation” which means the shifting or moving of a coordinate system across a plane (in the two-dimensional case)
There are two coordinate system involved: one is UTM (Universal Transverse Mercator), the map projection TransDEM uses internally for all its geo data. The other is the Trainz coordinate system, often called Trainz World Coordinates, or TWC.
Both coordinate systems are in metres.
Both coordinate systems are of the Cartesian type. To put it shortly, they are of the kind you would expect. Read more about them here:
https://en.wikipedia.org/wiki/Cartesian ... ate_systemTWC PreparationTo make the TWC visible, we have to switch them on in Surveyor settings (shown for T:ANE here). The option is called “Camera Location”.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc01.jpg)
The name isn't quite correct, because the position indicated will be the compass location, the so-called “look-at” point in 3D lingo. Once the option is switched on, TWC will be shown in the lower left corner of Surveyor.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc02.jpg)
There is an X and Y value. But their directions are not what you might expect:
- The X axis points south.
- The Y axis points east.
This is important to remember.
Tutorial Route For the following examples we work with geo data loaded in TransDEM and a route open in Surveyor. The route is called 082o04, it's in Canada and uses Canadian geo data. This tutorial explains how to produce it:
viewtopic.php?f=6&t=426 TWC Origin and UTM False OriginThere is one point on our route, where TWC are [0,0], the TWC origin. For a TransDEM based route, the TW coordinates [0,0] point to the north west corner of the baseboard where TransDEM places the World Origin object. That World Origin will be at the centre of that baseboard and will have TWC values of [360, 360] (A baseboard is 720 x 720 m).
Let's try and find the WO: With 082o04 open in Surveyor, we open the main menu, click on “Edit Environment”, then on the middle tab, and finally on the spanner button: “Find World Origin”. (
In my understanding I would expect the magnifying glass to be the icon for finding and the spanner for editing, so I am always confused here.)
Surveyor now shows us the WO object with the compass positioned 10 metres further north. TWC shown are [350, 360] which does make sense, since they indicate the compass location.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc03.jpg)
The next thing we have to do is to associate TWC [0, 0] to some UTM coordinates. We usually call this an “offset”, cartographers often say “false origin” to it. To find these UTM coordinates we examine the baseboard with the route in Surveyor and in TransDEM. One way is to go through the latitude and longitude of the WO, but a bug in T:ANE tends to reset these and would mislead us. We can also go by identifiable map features.
In Surveyor we zoom out – without moving the compass (!) – until we see the baseboard raster and a bit further until we read “Mount Borgeau” which will be our clue for TransDEM (
Again: lat/long would fulfil the same purpose.)
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc04.jpg)
In TransDEM I have marked this baseboard with the mask.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc05.jpg)
Let's look at the following drawing, showing the baseboard with the WO. The north-west corner is TWC [0, 0] and we need the UTM coordinates for it.
![Image](http://img.transdem.de/albums/userpics/10001/utm2twc06.png)
I usually place control points in TransDEM for exact locations. You can also read the UTM values from the TransDEM status line, 11U 587837 5665680.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc07.jpg)
The exact location will always be a multiple of 40 m: 587840 5665680, as I have set it manually in the control point properties:
![Image](http://img.transdem.de/albums/userpics/10001/utm2twc08.png)
Now we come to the formulas.
UTM → TWC
(1) x = n0 – n
(2) y = e – e0
TWC → UTM
(3) e = e0 + y
(4) n = n0 – x
with
x : TWC X
y : TWC Y
e : UTM easting
n : UTM northing
e0 : UTM easting of false origin (offset)
n0 : UTM northing of false origin (offset)
Your calculator will be able to handle the computation but I have prepared a spreadsheet to assist us. You can download it here:
http://transdem.de/download/public/misc ... MtoTWC.ods It's in Open Office / Libre Office format.
(There is also an Excel 2000 variant here:
http://transdem.de/download/public/misc ... MtoTWC.xls , but I won't guarantee for it, I haven't used MS office for 15 years.)
We start with entering e0 and n0 as the UTM False Origin:
Testing the WO locationFor a first test we try the location of the WO. I placed a second control point in TransDEM, where TransDEM would put the WO in the Trainz route. Its UTM coordinates are e = e0 + 360 and n = n0 – 360, or [588200, 5665320]. And indeed, the spreadsheet yields [360,360].
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc10.png)
It also works the other way round. Entering [360, 360] as TWC values yields [588200, 5665320].
UTC to TWCNow for more practical example. I want to locate the exit from the Trans Canada Highway in the Trainz route.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc12.jpg)
Making it easy, I choose the intersection of UTM 1000 m grid lines. So the UTM coordinates are [592000, 5668000]. The spreadsheet tells me, TWC are [-2320, 4160]
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc13.png)
And there we are in Surveyor:
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc14.jpg)
(We wouldn't really need the coordinate conversion here as long as the UTM grid lines are still visible in Surveyor, as the would provide enough guidance.) TWC to UTMIn the last example we look for the UTM coordinates wee look for the UTM coordinates of the northern abutment of a railway bridge near Bankhead.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc15.jpg)
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc16.jpg)
TWC are [-8210, 14414]. The spreadsheet yields [602254, 5673890] for UTM.
![Image](http://img.transdem.de/albums/userpics/10001/thumb_utm2twc17.png)
We verify it with another control point in TransDEM:
SummaryThe relationship between Trainz World Coordinates and UTM for a TransDEM based route is a simple mathematical “translation” (shifting) with an offset and swapped axes, including a negative sign. The offset is determined through the baseboard carrying the World Origin. A spreadsheet facilitates the computations.