NEW!!! NEW!!! NEW!!!

The data collection for this will be ending for the time being. I think I've proved my point, and I have some new things in the works as far as these trains go. To that end there will be hardware and software changes, and those will take time.
What we're doing is adding cameras at more intersections. I'm also writing some software for train enthusiasts, though that will not be part of this project. It will, of course, occupy some of my time, leaving less for this project.
Bottom line: Data collection will be ending, but the project continues in the background. I'll post updates here when everything is in place.
Any comments or questions on any of this? Email me at dougmsbbs@gmail.com and I'll be happy to discuss it.

Goshen Has A Train Problem

And It's Worse Than You

Probably Thought.


Before I get started, I should point out that you can head over to the Train Data Totals page to get the information in calendar format. I hope you'll read all of this first, but the options yours...

Anyone who is familiar with Goshen, Indiana knows the frustrations of dealing with its trains. There are a lot of them, they are noisy, and they frequently bring traffic to a standstill. It's not at all unusual here to plan extra time and leave early if you need to get to an appointment.

It's a town with a population of around thirty three thousand, located in north central Indiana. If you take a look at the map you'll see it's located at just the right place for land traffic moving east and west from the top part of the country to get around the Great Lakes. The railroads know that, of course, and that's why they put in the 'big three' tracks here.

Three lines come through town, passing only a couple of blocks from the downtown area. The tracks almost split the town in two. All three run side by side for most of the way.

Two of the lines continue straight through, while one turns and goes south, heading towards the Indianapolis area.

I certainly can't leave out the fact that our neighbor to the west, Elkhart, has a large rail yard. It certainly factors into how many trains go through Goshen.

I also want to note that there are currently NO quiet zones in Goshen, although that's being looked at for the line that goes south. Please keep that in mind while looking over the figures on just how many trains there actually are flying through town, every one of them blowing those darn horns all the way through.

The problem with all this is, with all the belly aching and cursing that goes on here, no one really knows how many trains there are, how long they are, or how many people are spending their travel time sitting and waiting on trains.

Ask the railroad, Norfolk Southern in this case, and they might tell you (or might not, which is actually the probable outcome of asking) what the real numbers are. And being the kind of guy I am, I probably (okay, there's zero chance) wouldn't believe them anyway.

So, again, being the kind of guy I am, I set out to get the hard numbers for myself. I'm what they now call a 'maker', which means I can build things that make other people shake their heads and ask 'but why?' a lot. Let them wonder. I'm used to it.

Please don't skip right over to the numbers without reading the rest of this. You'll get a better feel for what the numbers really mean if you know how they were gathered, and you'll have a good feeling that they are the real numbers and not something some big company tossed at you.

And I can prove it. I've got visual evidence of every bit of it.

As a final note before I get to the how, I should tell you that I did this same thing back in 2008. It was with different hardware and software, though. Somehow I've managed to lose the actual data from that time, but the conclusions, that I still have. I'll toss those out there when I get to the numbers from this time. But I guess I can give you a clue: the trains are both longer and more numerous. Not a surprise to any one who lives here.

The Location:

It was important to cover all three tracks. I don't want to bother with all this if I can't do it right.

As circumstances have it, I live about a block north of the tracks, and from the top of the hill I can see the tracks and crossing arms from a south facing window. All three tracks go right past there, with the one turning to the south just to the east of the crossing. So I'm good to go there. And as a bonus, I've found that the Indiana Department of Transportation has a website with traffic counts for a number of locations around town. One is just to the east of the crossing on Ind. 4. The other is to the west of the crossing, and has a higher traffic count. I think that's because 8th street is a big feeder to Ind. 4, and most of that traffic heads towards or is coming from downtown area, and that's west of there. I'm going to use the traffic count from the location to the east of the crossing, mainly because there is only one turnoff from there, Logan St., so any traffic crossing the counting location is most probably heading across the tracks. It also keeps my figures on the impact of all these trains on the conservative side.

The tracks are the red lines. The area inside of the green circle is the area of interest to me. While the view I have is of the Cottage St. crossing, it's a good stand-in for the Ind. 4 State highway crossing right next to it. It's only about 480 feet away. The tracks are about 700 feet from my house. If one crossing is blocked, so is the other one.

I'll add that there is another track right here also, for a total of four, put in a couple of years ago for a local company to use without blocking the main lines. That sounds real good, if you're the company or the city (who collects all those extra tax dollars they generate) but it's really a bummer for those who live here. I call it 'the shuttle' because that's what they do all day long sometimes, shuttle back and forth, hitching and unhitching train cars for hours on end, intermittently blocking the crossing for ten or fifteen minutes at a time.

So where was I?

Oh, right, I have a view of the tracks. Go me!

That brings me to the actual 'how' of getting this done, and that starts with...

The Hardware:

Obviously I can't sit there all day and night and count trains, with a stop watch in my hand. So I needed something to do that for me.

An old webcam, decades old and minus it's cover, will do the job. Couple that with an old scratched telephoto lens that fits no camera I own, a few pieces of PVC fittings, an hour in the shop, and I had something I could use to watch for trains. A 'C' clamp holds it in place without putting screws into the window frame, mostly out of sight of the wife, who puts up with a lot around here anyway, and making this thing 'in her face' all day long seemed unwise. (For those who know me, this proves you wrong. I can be taught new tricks!)

This is what the contraption looks like:

One other thing needed was something to plug that webcam into, and for that I pulled an old laptop off the junk pile I call 'my office' or 'my shop', and sometimes more accurately 'who made this mess?!?!?', but that's neither here nor there at the moment. I found it in one of the piles so that's all that counts.

The laptop has a busted hinge and takes about twenty minutes to boot up, but I intend for it to run non-stop for weeks, so I can live with that. Looking back, that 'non-stop for weeks' thing was a tad bit overly optimistic. But such is life. It does have a tendency to require a reboot every few days, but only after you go to bed or leave the house for a while, so there is that. I'm still trying to figure out how it knows the best time (from it's point of view) to go down. The only thing I have come up with is 'Murphy's law', and that may be valid, since Murphy seems to winter over at my house. Summers he seems to leave me alone, evidenced by the fact that I haven't lost any toes while mowing the lawn recently.

Well, that's all the hardware I'm going to need. So we better get working on...

The Software:

Lucky for me I taught myself how to program back in the late seventies and early eighties. At the rate programmers like me charge there's no way I could afford to even hire myself to do the job. And I'm cheap! (again, for those that know me, no big revelation there, eh?)

The first program I wrote simply collects the data and writes it out to a coma separated values file. A second program reads that file in when I go to collect the nights data, adds it to a database, and displays it on a day sheet that gives you a good look at what the numbers really represent.

If the picture looks funny, well, it is. But there's a good reason for it. Keep in mind that the program has to collect images night and day, rain or shine. Turns out it's the bright days that are the hardest. The sun tends to overwhelm the camera and wash everything out, and clouds coming and going mess it up worse as the camera tries to adjust. Night time is easy, the screen is pitch black until the crossing lights come on, and then there's no doubt there's a train.

I wound up putting a couple of filters in place over the lens to keep some of the morning glare out. I also have it set to where my program adjusts the contrast second by second as conditions change, and I have it set rather dark. It's to the point right now where I can just let it run night and day and it makes whatever adjustments it needs to make.

I obviously can't put a sensor on the tracks to detect trains, so a camera is the best way to go. I tried motion detection and all kinds of other things first, but none worked all the time under all conditions. So the picture looks strange, but the software has it all under control.

The software has all the bells and whistles it needs, but little else. It works, which is all I care about. It's not something for sale, so it's just fine as it is. Well, it's fine up until the laptop decides it needs to mess with me, but that's hardly the software's fault. It is, after all, just software, and it's doing the best that it can.

As you can see I can draw a rectangle around just the crossing guards lights. That's then blown up, as you can see in the smaller picture on the screen. What it all comes down to is the programs divides that smaller rectangle in half, roughly, then watches for changes in brightness in the two lights. When one is brighter than the other outside of a small range, you've got a train. I say 'roughly' because I'm basically comparing each half against the other, but it's impossible to draw a rectangle on that picture so that each side is exactly balanced with the other. So what happens is I have the program moving the dividing line one way or the other to make them of equal brightness, up to a point, and do it only while there is no train. As soon as a train is detected all adjustments in brightness and contrast stop for the duration.

I can hear you asking why not look for the color red? That would be obvious, right? Well, it's not that easy. At night that red shows up as white in the lights themselves, and a randomly changing smear of red all over the screen in other places. It was too hard to pin down what was going on, unless I sat there and baby-sat it. Wasn't going to happen.

One other thing that program does is save an image of that small rectangle every five seconds while there's a train. That's my check, so I can validate there really was a train there when I get up the next morning. Every train in this study was verified like that, Every. Single. One of them... sigh.

So that's the data collection. What about doing something meaningful with all that data?

That's where the second program comes in. It reads in the raw data, saves it into a database that we can search through, and arranges the data in meaningful ways that help us make sense of it all.

There are two parts of this program. One does the importing and lets me check the data, the other displays it in calendar form.

Notice all the images for that train? Trust me, there was a train when it said there was.

The interesting part of this program is the second part, the data display. Make sure your ready for this, it's a real eye opener!

But first I'll add that there are blocks that are shown where there were no trains. Those we can blame on the laptop and Mr. Murphy. I added a way to block them out and mark them as such so everyone would know why no trains are shown then. There may have been trains going through, but I'm not going to guess about it, and I'll settle for just knowing the program was down right then. The end result of it is there are probably more trains than shown, but I'd rather stay on the conservative side of the curve. I don't want anyone saying I'm exaggerating any of this, and it's bad enough I don't have to.

The picture at the top of this page shows the results for the first couple of weeks.

That's a lot of trains!

That covers the what's, why's and how's. So how about some results sir?

Oh, of course! As the wise man once said..

All we want are the facts, ma'am:

In those 17 days there were 1,078 trains.

Yes, you heard me correctly. One thousand seventy eight trains. And I didn't get them all. Notice the salmon colored blocks? Those are times when I wasn't collecting data at all.

Green means a train under five minutes. Yellow means it was between five and ten minutes, and red means the crossing was blocked for more than ten minutes. And this is a state highway, folks, not a little side street with nothing going on.

Every little bar on that chart is a train, it's thickness showing how long it lasted.

Well, okay, that's not a perfectly truthful statement. I should have mentioned this before, so excuse me for just remembering to comment on it.

You see, the program is not really counting trains. What it's actually doing is counting the number of times and for how long the crossing was blocked by trains. With four tracks right here, there can be and frequently is more than one train at a time. I'm only catching the fact that the darn gates are down, not how many trains are passing on the other side of them.

But I don't see that as a disadvantage at all. After all, aren't you really more interested in how many times and for how long you have to wait on a train, and not the actual count of trains flying by? Sure you are.

I'll give you some rough numbers now. I say rough, because the experiment is hardly done yet. As a matter of fact, I really considered this period as more of a testing phase than anything else. I'm going to let it run for a while longer before I get serious about extracting every last little fact and figure from it. So I'll obviously have an update and a better presentation of the results at some point in the future.

The average length of those trains was three minutes sixteen seconds, up from two minutes thirty seconds in 2008.

The shortest train was twenty five seconds (Amtrac).

The longest was two hours fifty one minutes and twenty seconds. Yes, I verified it. It was on October 14th, and began at just after midnight.

The average time between trains is nineteen minutes.

The most number of trains on one day was on Monday the 16th, at eighty one (81!).

If you add up all the minutes of every train during a day, you'd find it normal to have a total of between two and a half (2.5) and four (4) hours a day where the crossing is blocked. The record is on the 14th, where that almost three hour shutdown pushed that days total up to six hours fifty four minutes and twenty one seconds.

Most days you can expect between 2.2 and 3.8 trains per hour.

You can expect to wait ten minutes or more on a train at least three times a day. There were no days when there was only one ten minute plus train, and only two days had only two ten minute or longer ones.

Now comes the new part, at least to me. Since I found the state database of traffic counts available online, I decided to take a glance at just how many cars, on average, are waiting for these trains everyday. Keep in mind that this is only an average, and preliminary, at that. It's also only at one crossing. I'd like to emphasize that: this is all at one crossing!

I broke it down by the hour for each day. The state provides data for each fifteen minute period, but I thought I'd leave it at an hour until I get even more data in. Basically, I wanted to peek at it, a salve for a serious case of curiosity that I picked up somewhere. Don't worry, it's not dangerous, but it is contagious.

So for each train I looked at that hour of the day, grabbed the number of vehicles the state said went through there at that time of day, and figured out by the length of the train how many had to stop and wait. Simple, right?

So far the rough numbers tell me that between 800 and 1,200 vehicles sit at this crossing waiting for the darn gates to go up, every single day. Not only that, but that there is a good chance that it will be for ten minutes or more opened my eyes up. 'So tell me, do you feel lucky' he says in his best Clint Eastwood voice. (It's not a very good voice. Closer to a looney tune's voice than a Clint Eastwood, but we all use what we got, right?)

So there is the first look at what many consider a real problem.

Not everyone, I know that, but many.

It's not only inconvenient to be stuck in traffic this many times a day, it's a drag on our economy. With all those people stuck at crossings, they're not getting to work or to their doctors appointments on time. The trucks sitting there belching out fumes aren't delivering the products to stores, they're just adding to the crap we breath and call air.

How about the safety aspects of all those blocked crossings? Decades ago the city built our one and only overpass, and it doesn't even cover the tracks that go south. With fire and police on one side of those tracks and the only way around a blocked crossing being an overpass which only leads them into a maze of tight residential streets, can they really get there as fast as they could if they were able to take the direct route?

To be fair, we are getting an overpass over the south going tracks. It's a work in process right now and expected to be done next year. And while it will take a serious bite out of traffic waiting on trains along that run, it won't help the north side of the tracks at all.

Depending on where your going, it's going to take using both overpasses to get out of the north side of town. That involves goes through those same narrow residential streets that the police and fire have to deal with, and then a left turn across traffic on one of the busiest streets in the city. You can wind up waiting just as long to make that left turn as it takes for a train crossing to clear.

I will add one more thing: From where I live I can see the new overpass as it rises, passing mere yards from the crossing lights I'm using to count the time the crossing is blocked. It runs parallel to the four main tracks. The problem with that is exactly what I inquired about during several city meetings as the design of the overpass was being planned: What will a solid wall rising up above the height of a train do to sound from those train whistles?

When I asked it I got no response. None. But the answer is already here even before the overpass is complete. It makes a lot more noise aimed into the residential areas. I'd say at least 35% more already, and the trees haven't even dropped their leaves yet. I'm sure it'll get worse from here on out.

But at least two thirds of the city will not have to wait for trains anymore, so it's all good. Who cares about the north side anyway?