TransDEM Forum

TransDEM News, Support, Hints and Resources
It is currently 26 Sep 2023 13:10

All times are UTC + 1 hour

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 25 Mar 2016 15:34 

Joined: 05 Jan 2011 16:45
Posts: 1399
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.


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: ... ate_system

TWC Preparation

To make the TWC visible, we have to switch them on in Surveyor settings (shown for T:ANE here). The option is called “Camera Location”.


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.


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 Origin

There 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.


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.)


In TransDEM I have marked this baseboard with the mask.


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.


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.


The exact location will always be a multiple of 40 m: 587840 5665680, as I have set it manually in the control point properties:


Now we come to the formulas.

(1) x = n0 – n
(2) y = e – e0

(3) e = e0 + y
(4) n = n0 – x

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: ... MtoTWC.ods It's in Open Office / Libre Office format.
(There is also an Excel 2000 variant here: ... 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 location

For 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].


It also works the other way round. Entering [360, 360] as TWC values yields [588200, 5665320].



Now for more practical example. I want to locate the exit from the Trans Canada Highway in the Trainz route.


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]


And there we are in Surveyor:


(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.)


In 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.


TWC are [-8210, 14414]. The spreadsheet yields [602254, 5673890] for UTM.


We verify it with another control point in TransDEM:



The 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.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

Imprint & Privacy

Powered by phpBB® Forum Software © phpBB Group