Laying track on a DEM?

Blutorse4792

Now T:ANE I can get into
How do I go about getting a nice, smooth right-of-way on my newly generated DEM route?

I know that railroads use cut-and-fill, and that they aren't perfectly even/flat (Even here in Illinois), but I'm having trouble with the "roller-coaster" effect when I lay track.

I'm just starting to get serious about route building, so forgive my ignorance if I don't understand some of the technical aspects.

Thank you.
 
A DEM pretty much represents the ground as it existed before the railroad arrived. Occasionally on a high-res DEM you might get a hint of trackbed, but mostly you get virgin ground. I start by finding a reasonably 'level' area and pretty much wing it from there. Some folks use actual railroad track data and try to lay 1.7 miles of track at the exact 1.2% (or whatever) grade the real railroad used. Sometimes that works and sometimes it doesn't, because sometimes the DEM is showing true ground level and sometimes it isn't. You need to settle for an approximation of the real railroad's grades. Where the ground goes up, the track goes up. Where the ground goes down the track goes down. The difference is that in general the track doesn't go up or down as much as the ground does. The highest points on the ground will tend to be cut, the lowest points will tend to be filled. The track will TRY to be as level as it can. If your cuts get too deep make the track higher. If your fills get too high make your track lower. Trial and error is your friend! I quite often change grades three or four times before I'm happy that the track sits on, over and through the ground in a manner that looks right. As a rule of thumb you should aim for your cuts to about equal the fills, that's what the real railroad did. They want to neither truck dirt in nor truck dirt out, they just aim to move it about a bit to create the most level trackbed possible....
 
A DEM can be off by +20'/-20' in all the x-y-z locations (with river channels up on hillsides, and track in river channels). Tall trees and buildings throw the DEM creation off. I look straight down, and lay track, making a curve, connect to a straight. Once satisfied I manually sink each and every spline point to just slightly before where the track spline points appears to be underground. I measure my track gradient and make sure it stays between 0.10% to 0.30% gradients, (however gradients upward of 1.75% are usually the maximum). Where a gradient measures some rediculous gradient of 3.98%, that area is usualy where a deep cut was made by RR construction crews.

I never hit the "Smooth Spline Tool" button until my route is completely finished, as it will permanently deform your DEM (you can view what the "Smooth Spline Tool" button will do, then go backwards 100 times using "Undo" or Ctrl+z

I test drive my route using the Jet Sled at speeds of 786 mph !
 
Last edited:
A DEM can be off by +20'/-20' in all the x-y-z locations (with river channels up on hillsides, and track in river channels). Tall trees and buildings throw the DEM creation off.
As a general statement this is not quite correct.

It all depends on the DEM source.

Orbital DEMs such as SRTM or ASTER are most likely subject to vertical error. And here indeed forests or built-up areas will influence the DEM. Horizontal error had been noticed in the first generation ASTER DEMs 10 years ago, not to be confused with the post-processed ASTER GDEM of today. Manually created DEMs, like Viewfinder-Panoramas, may also be slightly off in horizontal direction. Rivers flowing uphill is a different problem. The once popular 1:160,000 TIGER data may not be accurate enough to match the DEM. That's a map problem, not a DEM issue.

Terrestrial DEMs such as USGS NED will have much less vertical error than orbital DEMs. They will generally model the land and water surface of the earth, including earthworks, but excluding most civil engineering structures, and totally ignore vegetation. Higher resolution terrestrial DEMs may indicate railway cuttings and embankments, as Dermmy has already pointed out. Particularly NED 1/3 arc sec (and 1/9 arc sec where available) can be very detailed here. However, not all 1/3 arc sec NED DEMs already provide this accuracy.

Horizontal accuracy of a DEM depends on horizontal resolution. 1 arc sec, for instance, translates to 30 x 20 m for moderate latitudes. And that's the horizontal accuracy you can get from that DEM. There is a DEM point every 20 or 30 m. In-between points will be interpolated.

Higher resolution DEMs also require better than 1 m vertical resolution. Otherwise you will see a terracing effect. The DEM file format plays a role here, too. Only some file formats allow floating point notation. The remaining formats for NED DEMs, obtained via the National Map Viewer, are now floating point only, but older NED DEMs floating around may still have integer elevation.

Here is a typical example of 1/3 NED arc sec in Trainz Surveyor:


DEM source view as a shaded relief:



PS: Do not confuse "DEM" with "DEM-based Trainz route". Some Trainz users mix the two terms. The transfer mechanism from DEM to Trainz may introduce additional error or overly smooth the terrain, yielding a much more levelled landscape in Trainz compared to the one in the original DEM.
 
Thanks to all three of you for the info. Sorry for the delayed response, I'd typed one up but forgot to post it.

So, it seems that I will have to lay my tracks, and raise lower the spline to ensure a smooth ride. Is the next step using the "smooth spline tool" (as Cascade pointed out, after the route is finished) to create the cuts and fills? Is there any particular way to ensure that multiple tracks (There are sections of my route with 6 tracks running parallel) are all at the same height?
 
You've pretty much got it, though when you use the 'smooth spline' tool is pretty much up to you. I tend to work a couple of miles at a time, getting everything more or less up to 'finished' status in an area before moving on. I find it keeps things more varied and interesting. If I tried to 'finish' all the track before I did anything else I would burn out!

Keeping multiple tracks level is easy! If there is a spline vertex on one track, repeat it across all tracks. Get one track right, then just use the 'Get Height' and 'Apply Height' tools across the row of vertexes. The only other 'trick' is that if you use the 'straighten' tool on one track, use it on the same track segment across all parallel tracks. The 'straighten' tool works in both horizontal and vertical planes and it changes the vertical geometry of the adjoining track segments...

Andy
 
When all your track is finish laid on your route ... Remove all the straight sections of multi-tracked splines ... and replace them with single track, and straighten them all, one track at a time, so your entire route is single track splines.

Where there is a passing/twin track, the adjacent spline point height should be the same height as the track that you are using as a gradient height (use only one particular track as a gradient application).

As I have 06 ... I would be an excellent candidate for you to send your route as a CDP ... and I could check it for you as a Beta Tester, and make subtle curve/gradient changes, and return the revised route back to you.
 
Last edited:
Alright, thank you guys for the advice, I think I've gotten the hang of it.

Cascade, thank you for the offer, I will contact you once I have something a bit more presentable.
 
You've pretty much got it, though when you use the 'smooth spline' tool is pretty much up to you. I tend to work a couple of miles at a time, getting everything more or less up to 'finished' status in an area before moving on. I find it keeps things more varied and interesting. If I tried to 'finish' all the track before I did anything else I would burn out!

Keeping multiple tracks level is easy! If there is a spline vertex on one track, repeat it across all tracks. Get one track right, then just use the 'Get Height' and 'Apply Height' tools across the row of vertexes. The only other 'trick' is that if you use the 'straighten' tool on one track, use it on the same track segment across all parallel tracks. The 'straighten' tool works in both horizontal and vertical planes and it changes the vertical geometry of the adjoining track segments...

Andy

This is how I work with Dem-generated routes as well, Andy. It's much easier than doing the whole adjustment at the end. When I'm done with that section, I go for a cab ride while using the custom hud. This helps me find any odd grades I may have created or missed. I then take note of where they are and go back and adjust them.

John
 
The other issue with doing all the terrain smoothing at the same time it means you have to drop every track vertex on the route at the same time! I know there are 'fill' tracks that don't need that step, but my favourite tracks still need dropped. Doing every track vertex on an entire route at the same time is just not gonna happen!!!

Andy ;)
 
I just jumped into building my route, didn't even try the "driving tutorials", I can learn to drive when the route is finished... if I live that long! I more or less figured out what you gurus have suggested, with a tip or two from John and Sniper, bless them. My TransDem track was a real roller coaster. About a third of the route goes through a very narrow valley. It's just a walking trail now, and I've walked maybe half of it over the years. There are areas with less than 100 feet between a river and a cliff. Anyway, after playing around with it for awhile, things are looking up. Man, is there anything better than riding along on nice smooth track!? Many more miles to fix, but it's worth it. I was just going to lie about it and blame it on the frost, but now, I just gotta have that smooth ride. I don't know why my loco didn't hop right off the rails in some areas! I fixed about 30 miles or so. In that section there are still two bumps and about a 100 yard rough section, don't know how I missed them. Perhaps the frost caused it? I'll have to find them next time I'm working in that area.

Cheers...Rick
 
If you can access topo maps of the area your building in, at a small enough scale (say 10 ft contour lines) these will indicate railroad bed cut and fills. It helps a lot when your building prototypical routes. I have found that US 1/3 arc sec DEM data generally is accurate to about + or - 10' elevation when converted to TS12 maps with a '0' smoothing facter. However, horizontally this data may be off up to 30 meters (100 ft.). I think some windage should be tolerated due to the DEM interpolation and conversion calculations. Dr Z has a greater understanding of the conversion process and the countless mathematical computations involved. He can better anwer inquiries about the actual map generation.
 
A warning: even if you do have access to topo maps at a small enough scale, you need to beware of errors. I'm working with a USGS topo with 10 foot contour lines from the latest series, and find that there are a number of streets shown which do not actually exist. I suspect that they may in some cases they may be in fact public rights of way which have never been developed. In another case, a stream is shown as above ground where it is, and apparently has been for years, buried in a culvert. I highly recommend using online mapping tools (I prefer Google's Earth and Maps) to confirm what you see on the topographic maps.

ns
 
@ steamboateng. While there may be a marginal mismatch in elevation in older DEM, most recent data should be spot-on and a horizontal mismatch is I suspect a result of not properly entering co-ordinates. Almost by definition the horizontal alignment should be absolute.

not really @ mjolnr in particular but rather a random musing on the direction Trainz is going. I see so many posts citing wrong bogies, no custom cab, really picking at the slightest error in new models and now we are concerned about whether a waterway is an open stream or if it should be a culvert. We are losing the plot....
 
A warning: even if you do have access to topo maps at a small enough scale, you need to beware of errors. I'm working with a USGS topo with 10 foot contour lines from the latest series, and find that there are a number of streets shown which do not actually exist. I suspect that they may in some cases they may be in fact public rights of way which have never been developed. In another case, a stream is shown as above ground where it is, and apparently has been for years, buried in a culvert. I highly recommend using online mapping tools (I prefer Google's Earth and Maps) to confirm what you see on the topographic maps.

ns

In some cases too, streets may have existed when the topo maps were created, or maybe they were proposed but never built. Many of the maps on the USGS server were created in the 1960s and 1970s and updated in the early 1980s, or are much older and were updated over the years. I know because I have some of the same ones in paper and I purchased mine in the early 1980s. On many of these maps, they show railroad tracks that no longer exist as well as streets and buildings that are long gone. In my particular city, several streets disappeared during the early 1970s due to urban renewal, and the two railroad yards are long gone having been turned into parking lots and dirt lots.

In the scope of things, it's not worth worrying about this stuff. In fact a culvert here or there, or a stream out of place isn't going to ruin the route. All and all, seeing these older streets, tracks, and streams, makes things a lot better for us as it gives us a chance to put back many items that have long since disappeared. If anything you don't want the most up-to-date topo maps because many ROW and buildings have been obliterated by progress.

John
 
I suspected I may me walking into a swamp when I mentioned horizontal errors in defining elevation data.The subject is somewhat complex, so careful wording in lay language is difficult. What I was alluding to was not errors in source DEM data, but errors in the Trainz generated DEM map. Certainly not errors in georeferencing topo maps to the DEM.
Georeferecing raster map data requires two user generated data inputs which define the map overlay position: generally, the first is a Datum reference; on USGS 7.5 or 15 min. maps this will be NAD27 or NAD83, which defines how latitude and longitude data is applied to the map; the other user input is the actual latitude and longitude grid coordinates themselves, of which two points, at a minimum , are necessary. Certainly, entering the wrong data will generate horizontal errors onto the overlay. TransDEM will then convert latitude and longitude to UTM coordinates.
All this is fine, and TransDEM does a great job at it. But it's not what I'm alluding to.
The practical application of TrainzDEMis simply to generate a usable map in Trainz; no more, no less.
That map is generated with a series of algorithms which define the terrain on the map. Those algorithms include a 'smoothing' factor, which is set to 3 by default. This is too much. A '0' factor is closer to reality.
The area I'm modeling is the gently rolling hills of eastern Massachusetts. In such terrain, a walk downhill is soon followed by another walk, uphill. The terrain is rarely anywhere flat. In generating this terrain in Trainz, the 'smoothing' factor has a tendency to raise lower terrain levels and lower higher terrain levels. Even when set to '0' this effect is readily apparent when using the 'Get height' tool in Surveyor. Explore a lake set in amongst the hills. The 'Get height' tool will indicate a higher level along the shore line, gradually falling to a low (hopefully lake level) and then gradually begin to rise again as it approaches the opposite shore. This has the practical effect of giving us shallow bowl shaped water surfaces on virgin TrainzDEM generated terrain maps. The opposite effect is true on hills; they being generated more conical than in reality.
Well, the effect of this inherent smoothing action is to offset vertical height data in a horizontal plane. Thus the error.
In exploring my Trainz maps I find thefollowing:
Large lakes generally have no or little height errors at their center.
Sea level is generally 0 ft. except at the shorelines.
Vertical hill height is up to 10 ft lower than indicated at their apex and may also be offset by up to 30 meters or more.
In practical Trainz route building terms, the above entry is no more than virtual marshmallow fluff , only meant as a pointer to where one may find map errors and why.
We use programs such as TransDEM to generate realistic terrain for our trainz to run. We're not geologists or cartograghers, We're Trainzers!
 
Last edited:
Mike,

Nah. This wasn't a swamp, this is quick sand. :)

I'm going to try your suggestion of setting the smoothing to zero. I ran into the exact issue you have described in Haverhill and Bradford where the tracks cross the Merrimack River. This is quite obvious in Bradford where South Pleasant, Middlesex, Laurel Avenue, and the "Bradford Bridge" all come together near the Bradford Depot. Laurel and South Pleasant come down hill towards the little square near the railroad bridge and mush into the track grade. I know there's quite a grade difference there from growing up in the area. On the Haverhill side, Washington Street, Moulton Way, Essex, and Winter Streets all mush into the tracks as well. Where the railroad crosses Washington Street, there is a difference of only 4 meters instead of 14 meters. This has made placing a rail bridge over the road in that location difficult.

A little off topic, but sort of related, I've replaced a big hunk of my route with the Exeter to Bradford section of the B&M. I've also included the old Georgetown Branch and the branch from Georgetown to Newburyport. This is what's so cool about this program. We can bring back to life rail lines that have long since been ripped up like the Bradford to Georgetown which was removed between 1946 and 1980. The Georgetown to Newburyport disappeared some time in the late 1930s after a hurricane washed out some bridges.

John
 
John, I spent a considerable time composing the reply above. It is an issue that only folks modeling a specific route along a 'historical' right-of-way, defined by map overlays, will encounter. Outside of us nit-pickers, it's a non-issue! The not so well thought out reply that the issue is related to georeferencing errors is hogwash. My route traverses 22 separate USGS - 7.5 min. map quadrants. Any mistake of even 30 meters in alignment would readily showup as misalignments of the map quadrants along the route. No such error is evident.
What is evident is that 'smoothing' magnifies hight errors along the horizontal plane. As we both know, even with a 0 'smoothing' factor, errors are introduced. This is noticable closely along the roadbed when encountering intersecting streets and waterways. Also, in truth, part of the issue is the DEM data. The USGS National server supplying NED data flatly states that vertical errors of approx. 8 ft. can be expected. I have closely examined my Tranz maps and find an error of about 10 ft. This error, when juxtaposed with a roadbed we believe to be set at an accurate height and at a reletively accurate coordinate location, can elicit quite a raucious round of salty expletives from this poor sailor......even at 4 am in the morn (thus eliciting another round of raucios explitives from cheif mate at breakfast - I taught her everything I know)!
These elevation issues are agravating, but managable. We fall back on topo maps and Google earth to define the discrepencies and start pushing baseboard vertxes the 'old fashioned' way.
I make no bones about TransDEM. It is an excellent program and I absolutely love it. Not only does it save countless hours in generating baseboard terrain, it also gives us the ability to georeference accurate topo maps to reproduce routes long gone. I love that ability.............chershed childhood memories walking along a right-of-way or riding the old coaches can come to virtual reality with some knowledge and dedication to the project.........
Enough, I'm sure Dr. Z will chime in on the subject. He knows what makes the program tick and perhaps can enlighten us.
 
@ steamboateng - off topic, but they are the best couple of posts I have read in the forum for ages. Nice one!
 
Back
Top