Beruflich Dokumente
Kultur Dokumente
Like many Trainz route builders who use TransDEM to model prototypical lines, I have Google
Earth images that I would like to use to help me place items with some degree of accuracy. As I
explored the options for doing so, I found myself unimpressed with the way UTM tiles work in
TS12; and basemaps would have required too much effort given the size of my route. What I
really wanted was a way to put a fairly decent representation of my Google Earth images directly
on the terrain; and after quite a bit of experimentation I arrived at the solution presented here.
A typical result of the process is shown in the illustration below. What youre looking at is
100% ground textures; there are no carrier objects of any kind being used. The good news is that
its pretty straightforward to make this work; and if you follow the instructions and suggestions
presented here, you should be able to achieve the same results for your own routes.
Legal Stuff
There is no copyright attached to this Tutorial. Members of the Trainz community may use it
and the associated files for any purpose, personal or commercial; and this text may be reproduced and/or converted into other formats or languages as may be needed for the benefit of the
community. I only ask that I be mentioned as the original author.
Google Earth images, on the other hand, are copyrighted. In the case of this Tutorial, this
means that you must not distribute your route with any part of the Google Earth image still remaining visible on the terrain. Later in this Tutorial, Ill describe some ways in which the image
can be erased; but it is your responsibility as the route builder to make sure this gets done.
Audience
This Tutorial is written for those who already have a good understanding of how TransDEM
works. This means that you know what a DEM is; what a georeferenced map and map group
are; how to acquire Google Earth images and georeference them in TransDEM; and how to use
TransDEM to generate a Trainz route. I also expect that you will be comfortable using the free
version of Google Earth 6, although Im going to show you some settings and options that are
either required or just happen to work well in conjunction with the techniques presented here.
Trainz software (TS2009, TS2010 or TS12) installed and operational on your PC.
TransDEM software installed and operational on your PC. This tutorial references version 2.1.3.1.
Google Earth 6 (free version) installed and operational on your PC, and a working internet connection so Google Earth can function.
A DEM of your route, already stitched together in TransDEM and ready for export to
Trainz.
The file WebColors.cdp, which contains a palette of 140 textures (all solid colors) that
will be used to draw the Google Earth image directly on the terrain of your Trainz route.
The file WebColorsXRef.txt, which is the custom color cross-reference that tells TransDEM when to use which of these 140 textures during the creation of your Trainz route.
WebColors.cdp and WebColorsXRef.txt are my creations and are at the heart of the techniques
described here; you should be able to get both from the same place where you got this Tutorial.
There is no installation per se for WebColorsXRef.txt, but you do need to put it someplace permanent where TransDEM (and you) will be able to find it later. I put mine in the same folder as
the TransDEM executable (i.e. C:\Program Files\Ziegler-Tools), but you can put it someplace
like your My Documents folder if youre more comfortable with that.
Later on, Ill explain how to make TransDEM actually use these textures and the cross-reference
file. Ill also be providing details about the cross-reference file that will allow advanced users to
expand upon my methods or alter them to suit their own needs.
The illustration shows how each item on the 3D tab is configured in my system (all the settings
on all the other tabs of this dialog are at their default values), as per the instructions in the main
TransDEM manual. In general, your settings need to match those shown here. In particular:
Ensure that Elevation Exaggeration is set to 0 (zero). This is critical; if you dont get
this right, your images will not match up where they overlap.
I have also found that there are other settings in Google Earth that can greatly enhance the usefulness of the captured images. They are located in the Layers area at the left of the screen, and
can make it a lot easier to visualize where roads and tracks go when the image is placed in a
Trainz route. The settings shown below are my personal preferences:
The last item of importance is to use the correct Eye Altitude. The trick here is to get low
enough to get the maximum amount of detail you can, while still keeping the resolution of the
image within the bounds that TransDEM can use. In order to see the Eye Altitude, the Google
Earth Status Bar must be turned on; youll then see something like this in the lower right corner.
If youve previously played around with using georeferenced maps as ground textures in TransDEM, you might have seen this message before:
If you get this message when you are preparing to generate a Trainz route, it means that the resolution of the image that you want to use as a ground texture is too high in the case of a Google
Earth image, it means your Eye Altitude was too close to the ground. Thus the trick is to find
an Eye Altitude that is close enough to the ground to give you as much detail as possible, while
also not producing this warning message in TransDEM.
After some trial and error, I finally settled on using an Eye Altitude of 5.0 km (on my Trainz PC)
when acquiring images to use with the techniques presented here. The illustration at the start of
this Tutorial shows ground textures produced from images taken at that altitude, so you can
judge the quality for yourself (Im happy with it, and I consider myself to be pretty picky).
The Eye Altitude that works for you may be different, and can be affected by many factors. The
best advice I can offer is to take single images at varying altitudes (so you dont waste a lot of
time gathering multiple images you may not be able to use); georeference them (one at a time);
and see if TransDEM complains when you try to generate a Trainz route with that one image as
the ground texture. When you find an altitude that works, then go ahead and take all your images at that same altitude, georeference them in TransDEM, and create your map group.
Go to Trainz
Export & Create: DEM & Ground Textures. Youll see a dialog that Im sure
you are quite familiar with; on my system it appears as shown in the illustration at the top of the
next page. Go through all your usual setups in this dialog according to your own preferences.
Within the frame at the bottom left of this dialog, select either TS2009 or TS2010 from the dropdown list, according to your version of Trainz (if you have TS12, select TS2010). Then tick the
option button named All in the section labeled 5 m grid in TS2009/10. This is very important,
as it quadruples the effective resolution of the generated ground texture image; as Ill explain a
bit later, ground textures are painted only at the intersections of the Trainz grid, so by using this
option we get 4 times as many intersections as we would if we used the standard 10 m grid.
Ive outlined this item in red in the illustration on the next page.
Now look for a check box named Custom Colour Textures in the middle of the dialog; it is outlined in green in the illustration. Place a tick in this check box now. Assuming you have never
ticked this check box before, TransDEM will now display a Windows Open File dialog; an example of how this might look is shown at the top of the next page.
Navigate to the place where you put the cross-reference file, WebColorsXRef.txt. Again, in my
system this is C:\Program Files\Ziegler-Tools, but on your system this location may be different
depending on where you saved the file earlier.
Select this file, and click Open. After you do that, the full path to this file will appear in the text
field next to the Custom Colour Textures check box in the TransDEM Export to Trainz dialog.
That field is outlined in purple in the image of the dialog.
You will also be presented with the following message:
Click OK to acknowledge this message. Now click OK at the bottom left of the TransDEM Export to Trainz dialog. The dialog will close and no Trainz Route will be generated. Instead,
you will be presented with another message:
Why this is set up this way, I have no idea; it certainly surprised me the first time through. In
any case, we have no choice here; so click OK to acknowledge this message, and then close
TransDEM.
Restart TransDEM. Once again, load your DEM and georeferenced Google Earth image(s),
along with any Simple Routes you might be using to control the generation of baseboards, and
draw your selection rectangle. Go to Trainz
Export & Create: DEM & Ground Textures.
The Export to Trainz dialog will now have the Custom Colour Textures checkbox ticked, and the
name of the cross-reference file will be displayed as previously mentioned. In my case this looks
like the image below.
Set up all your export parameters as normal, again being sure that the All option is ticked within
the 5 m Grid area (outlined in red in the image above), and then click OK at the bottom left of
this dialog. This time, your Trainz route will be generated as expected.
If you have any other items to export from TransDEM (track or road splines, etc.), go ahead and
do that now, as you normally would, and then close TransDEM.
"
Start Trainz and open Content Manager, then import your new route via File
Import Content.
After the import completes, right-click the route and select View
View In Surveyor. Surveyor
should open, showing your route with its nicely-detailed Google Earth image painted on top of
the DEM terrain.
In TS12, you can transition directly into and out of Satellite view, and this provides a big advantage when you have a fairly clear image like this right on the terrain. What I like to do is zoom
out; find a location of interest; center there; zoom in; and then work on the feature, zooming back
out every now and then to check my work.
If you paint over the image with other textures (grass, dirt, etc.), those areas of the images
are effectively obliterated just as if you had painted over a mural on a wall in your home.
If you have areas that you want to leave untextured, you can copy a section of blank
baseboard and then paste it over the image to delete the ground textures in those areas.
TransDEM offers a built-in function that will remove ground textures from a Trainz
route; you will find this on the Trainz menu as Remove Ground Textures. As of the date
this Tutorial was written, this function is fully compatible with TS2009 and TS2010, and
should work with TS12 as well. When you select this function, a warning will be displayed advising you to back up your route first. Assuming you wish to proceed, click
Yes in this message, and you will then see a dialog similar to the following illustration.
#$
Tick the option Specific KUIDs from file, which Ive outlined in red in the illustration.
Then click the Path button, and TransDEM will display a Windows Open File dialog.
Once again, locate the WebColorsXRef.txt file, select it, and then click Open. The path to
this file will then appear in the TransDEM Remove Ground Textures dialog.
As you can see, there are other options in this dialog as well; if you have already made a
backup of your route, you can leave them as shown in the illustration on the previous
page.
Now, click OK in this dialog, and TransDEM will remove any ground textures from your
routes GND file whose KUIDs match those listed in the cross-reference file. Note that
TransDEM does not provide any feedback about the results of this operation unless there
is a problem.
The final option is a bit riskier, but you can also delete all 140 of the special textures in
Content Manager (you can always reload them again from the CDP file), then open the
route in Surveyor; because the textures are now missing, the Google Earth image should
no longer be visible at all. Now use the Remove Missing Assets function to remove the
references to the texture KUIDs from the route, and save it. The image will then be gone
forever with no possibility of it ever being revealed to anyone in the future.
TransDEM can only emit a pixel from the Google Earth image where it lines up with
the intersections of the baseboard grid in Trainz. Thats why we used the 5 m option to
maximize the number of grid intersections and thereby improve the resolution of the terrain image by allowing us to get as many pixels from the original image as possible.
When TransDEM emits that pixel, it selects a texture from its built-in set of 20 that has
the closest RGB value to that of the pixel in the source image. It then emits a KUID for
that texture to the ground map to cause that color to get drawn at that location in Trainz.
TransDEM comes with a standard palette of only 20 colors with which to represent map images
using ground textures. This number was originally selected because versions of Trainz prior to
TS2009 only allowed 250 different textures in the entire route; and so, by limiting its palette to
20, TransDEM ensured that there was plenty of room left for the route builders own texture selection (this limitation has been raised to 250 different textures per baseboard from TS2009 onwards). These 20 colors were also selected very carefully; sixteen were derived from sampling a
variety of map images for the most commonly-occurring colors, while the remaining four are
pure White, Black, Cyan and Magenta.
While the resulting palette works very well for displaying topographic maps that dont have
many colors to start with, it was never really intended to be used to represent aerial photographs
which can contain up to 16.4 million colors. Thus, when TransDEM emits the Google Earth
image that Ive been using throughout this Tutorial using only its standard 20 colors it typically looks like the illustration at the top of the next page.
##
As you can see, the image is generally very dark, which makes it hard to discriminate features or
details. When you zoom in to actually do work, its even more of a challenge (at least for me)
because, with so few colors, everything pretty much just seems to blend together.
All my technique does is give TransDEM access to more colors, which also have a better
distribution across the RGB spectrum than the default 20. Simple as this is, it seems to make
a huge difference in the quality of the images that end up being visible in Trainz Surveyor. For
comparison, heres the image from the start of this Tutorial, which uses my 140-color palette:
The cross-reference file that accompanies this Tutorial, WebColorsXRef.txt, is a plain text file
that you can edit in Windows Notepad. It contains 140 RGB-to-KUID associations, formatted
with the RGB value on one line and the associated KUID on the next, as shown in the excerpt
below. Im not sure if the blank lines between entries are required or not, but the example in the
TransDEM manual was formatted that way so I went with it.
rgb 240,248,255
kuid <KUID2:606026:21001:1>
rgb 250,235,215
kuid <KUID2:606026:21002:1>
rgb 0,255,255
kuid <KUID2:606026:21003:1>
rgb 127,255,212
kuid <KUID2:606026:21004:1>
This excerpt shows only the first 4 of the 140 total entries in the file. When I created the palette,
I put the colors in alphabetical order (and created sequential KUIDs in that order as well), and
the entries in the cross-reference file are also in that very same order. So, in the example above,
the first RGB/KUID pair is for webAliceBlue; the next is for webAntiqueWhite; and so on.
In each entry, the RGB value in the cross-reference file is the same as that of the texture, in my
palette, that is referenced by the associated KUID. When this file is in effect (as it is when the
Custom Colour Textures checkbox is ticked), TransDEM searches the RGB values in this file
instead of its built-in list and when it finds the closest RGB match for the source image pixel, it
emits the KUID number of the texture associated with that value to the Trainz ground map.
If you decide to use different colors, you can easily create new textures by cloning the ones in
my palette and then modifying the files to suit your purposes. Youll then need to modify the
cross-reference file to have the appropriate RGB values and KUID numbers that match up to the
new textures you create. However, you must also keep in mind the limitation of 250 unique textures per baseboard that I mentioned earlier.
Conclusion
Thats all there is to this method. As I said before, theres nothing magical about it; I just decided to try an experiment, and when it turned out better than expected, I decided to share it with
the people in the Trainz community who have so generously shared their experience with me.
If you run into any issues with the process Ive presented here, please post your questions in the
Trainz forums (or shoot me a PM from there), and I will try my best to assist you.
Finally: Thanks to everyone in the Trainz community for their support, and to Dr. Roland Ziegler
for creating TransDEM in the first place without which none of this would be possible.
Regards,
- Mike Jenkins (ModelerMJ / 606026)
#
Asset Name
webAliceBlue
webAntiqueWhite
webAqua
webAquamarine
webAzure
webBeige
webBisque
webBlack
webBlanchedAlmond
webBlue
webBlueViolet
webBrown
webBurlywood
webCadetBlue
webChartreuse
webChocolate
webCoral
webCornflowerBlue
webCornsilk
webCrimson
webCyan
webDarkBlue
webDarkCyan
webDarkGoldenrod
webDarkGray
webDarkGreen
webDarkKhaki
webDarkMagenta
webDarkOliveGreen
webDarkOrange
webDarkOrchid
webDarkRed
webDarkSalmon
webDarkSeaGreen
webDarkSlateBlue
webDarkSlateGray
webDarkTurquoise
RGB (decimal)
240,248,255
250,235,215
0,255,255
127,255,212
240,255,255
245,245,220
255,228,196
0,0,0
255,255,205
0,0,255
138,43,226
165,42,42
222,184,135
95,158,160
127,255,0
210,105,30
255,127,80
100,149,237
255,248,220
220,20,60
0,255,255
0,0,139
0,139,139
184,134,11
169,169,169
0,100,0
189,183,107
139,0,139
85,107,47
255,140,0
153,50,204
139,0,0
233,150,122
143,188,143
72,61,139
47,79,79
0,206,209
KUID
<kuid2:606026:21001:1>
<kuid2:606026:21002:1>
<kuid2:606026:21003:1>
<kuid2:606026:21004:1>
<kuid2:606026:21005:1>
<kuid2:606026:21006:1>
<kuid2:606026:21007:1>
<kuid2:606026:21008:1>
<kuid2:606026:21009:1>
<kuid2:606026:21010:1>
<kuid2:606026:21011:1>
<kuid2:606026:21012:1>
<kuid2:606026:21013:1>
<kuid2:606026:21014:1>
<kuid2:606026:21015:1>
<kuid2:606026:21016:1>
<kuid2:606026:21017:1>
<kuid2:606026:21018:1>
<kuid2:606026:21019:1>
<kuid2:606026:21020:1>
<kuid2:606026:21021:1>
<kuid2:606026:21022:1>
<kuid2:606026:21023:1>
<kuid2:606026:21024:1>
<kuid2:606026:21025:1>
<kuid2:606026:21026:1>
<kuid2:606026:21027:1>
<kuid2:606026:21028:1>
<kuid2:606026:21029:1>
<kuid2:606026:21030:1>
<kuid2:606026:21031:1>
<kuid2:606026:21032:1>
<kuid2:606026:21033:1>
<kuid2:606026:21034:1>
<kuid2:606026:21035:1>
<kuid2:606026:21036:1>
<kuid2:606026:21037:1>
Sample
Index
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Asset Name
webDarkViolet
webDeepPink
webDeepSkyBlue
webDimGray
webDodgerBlue
webFireBrick
webFloralWhite
webForestGreen
webFuschia
webGainsboro
webGhostWhite
webGold
webGoldenrod
webGray
webGreen
webGreenYellow
webHoneyDew
webHotPink
webIndianRed
webIndigo
webIvory
webKhaki
webLavender
webLavenderBlush
webLawnGreen
webLemonChiffon
webLightBlue
webLightCoral
webLightCyan
webLightGoldenrodYellow
webLightGreen
webLightGray
webLightPink
webLightSalmon
webLightSeaGreen
webLightSkyBlue
webLightSlateGray
webLightSteelBlue
webLightYellow
webLime
webLimeGreen
webLinen
webMagenta
webMaroon
RGB (decimal)
148,0,211
255,20,147
0,191,255
105,105,105
30,144,255
178,34,34
255,250,240
34,139,34
255,0,255
220,220,220
248,248,255
255,215,0
218,165,32
128,128,128
0,128,0
173,255,47
240,255,240
255,105,180
205,92,92
75,0,130
255,240,240
240,230,140
230,230,250
255,240,245
124,252,0
255,250,205
173,216,230
240,128,128
224,255,255
250,250,210
144,238,144
211,211,211
255,182,193
255,160,122
32,178,170
135,206,250
119,136,153
176,196,222
255,255,224
0,255,0
50,205,50
250,240,230
255,0,255
128,0,0
KUID
<kuid2:606026:21038:1>
<kuid2:606026:21039:1>
<kuid2:606026:21040:1>
<kuid2:606026:21041:1>
<kuid2:606026:21042:1>
<kuid2:606026:21043:1>
<kuid2:606026:21044:1>
<kuid2:606026:21045:1>
<kuid2:606026:21046:1>
<kuid2:606026:21047:1>
<kuid2:606026:21048:1>
<kuid2:606026:21049:1>
<kuid2:606026:21050:1>
<kuid2:606026:21051:1>
<kuid2:606026:21052:1>
<kuid2:606026:21053:1>
<kuid2:606026:21054:1>
<kuid2:606026:21055:1>
<kuid2:606026:21056:1>
<kuid2:606026:21057:1>
<kuid2:606026:21058:1>
<kuid2:606026:21059:1>
<kuid2:606026:21060:1>
<kuid2:606026:21061:1>
<kuid2:606026:21062:1>
<kuid2:606026:21063:1>
<kuid2:606026:21064:1>
<kuid2:606026:21065:1>
<kuid2:606026:21066:1>
<kuid2:606026:21067:1>
<kuid2:606026:21068:1>
<kuid2:606026:21069:1>
<kuid2:606026:21070:1>
<kuid2:606026:21071:1>
<kuid2:606026:21072:1>
<kuid2:606026:21073:1>
<kuid2:606026:21074:1>
<kuid2:606026:21075:1>
<kuid2:606026:21076:1>
<kuid2:606026:21077:1>
<kuid2:606026:21078:1>
<kuid2:606026:21079:1>
<kuid2:606026:21080:1>
<kuid2:606026:21081:1>
Sample
Index
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
Asset Name
webMediumAquamarine
webMediumBlue
webMediumOrchid
webMediumPurple
webMediumSeaGreen
webMediumSlateBlue
webMediumSpringGreen
webMediumTurquoise
webMediumVioletRed
webMidnightBlue
webMintCream
webMistyRose
webMoccasin
webNavajoWhite
webNavy
webOldLace
webOlive
webOliveDrab
webOrange
webOrangeRed
webOrchid
webPaleGoldenrod
webPaleGreen
webPaleTurquoise
webPaleVioletRed
webPapayaWhip
webPeachPuff
webPeru
webPink
webPlum
webPowderBlue
webPurple
webRed
webRosyBrown
webRoyalBlue
webSaddleBrown
webSalmon
webSandyBrown
webSeaGreen
webSeaShell
webSienna
webSilver
webSkyBlue
webSlateBlue
RGB (decimal)
102,205,170
0,0,205
186,85,211
147,112,219
60,179,113
123,104,238
0,250,154
72,209,204
199,21,133
25,25,112
245,255,250
255,228,225
255,228,181
255,222,173
0,0,128
253,245,230
128,128,0
107,142,45
255,165,0
255,69,0
218,112,214
238,232,170
152,251,152
175,238,238
219,112,147
255,239,213
255,218,155
205,133,63
255,192,203
221,160,221
176,224,230
128,0,128
255,0,0
188,143,143
65,105,225
139,69,19
250,128,114
244,164,96
46,139,87
255,245,238
160,82,45
192,192,192
135,206,235
106,90,205
KUID
<kuid2:606026:21082:1>
<kuid2:606026:21083:1>
<kuid2:606026:21084:1>
<kuid2:606026:21085:1>
<kuid2:606026:21086:1>
<kuid2:606026:21087:1>
<kuid2:606026:21088:1>
<kuid2:606026:21089:1>
<kuid2:606026:21090:1>
<kuid2:606026:21091:1>
<kuid2:606026:21092:1>
<kuid2:606026:21093:1>
<kuid2:606026:21094:1>
<kuid2:606026:21095:1>
<kuid2:606026:21096:1>
<kuid2:606026:21097:1>
<kuid2:606026:21098:1>
<kuid2:606026:21099:1>
<kuid2:606026:21100:1>
<kuid2:606026:21101:1>
<kuid2:606026:21102:1>
<kuid2:606026:21103:1>
<kuid2:606026:21104:1>
<kuid2:606026:21105:1>
<kuid2:606026:21106:1>
<kuid2:606026:21107:1>
<kuid2:606026:21108:1>
<kuid2:606026:21109:1>
<kuid2:606026:21110:1>
<kuid2:606026:21111:1>
<kuid2:606026:21112:1>
<kuid2:606026:21113:1>
<kuid2:606026:21114:1>
<kuid2:606026:21115:1>
<kuid2:606026:21116:1>
<kuid2:606026:21117:1>
<kuid2:606026:21118:1>
<kuid2:606026:21119:1>
<kuid2:606026:21120:1>
<kuid2:606026:21121:1>
<kuid2:606026:21122:1>
<kuid2:606026:21123:1>
<kuid2:606026:21124:1>
<kuid2:606026:21125:1>
Sample
Index
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
Asset Name
webSlateGray
webSnow
webSpringGreen
webSteelBlue
webTan
webTeal
webThistle
webTomato
webTurquoise
webViolet
webWheat
webWhite
webWhiteSmoke
webYellow
webYellowGreen
RGB (decimal)
112,128,144
255,250,250
0,255,127
70,130,180
210,180,140
0,128,128
216,191,216
253,99,71
64,224,208
238,130,238
245,222,179
255,255,255
245,245,245
255,255,0
154,205,50
KUID
<kuid2:606026:21126:1>
<kuid2:606026:21127:1>
<kuid2:606026:21128:1>
<kuid2:606026:21129:1>
<kuid2:606026:21130:1>
<kuid2:606026:21131:1>
<kuid2:606026:21132:1>
<kuid2:606026:21133:1>
<kuid2:606026:21134:1>
<kuid2:606026:21135:1>
<kuid2:606026:21136:1>
<kuid2:606026:21137:1>
<kuid2:606026:21138:1>
<kuid2:606026:21139:1>
<kuid2:606026:21140:1>
Sample