4

I'm very new to the world of GIS, but I'm learning a great deal from this site, as well as others. I fell like this should be 'easy' but I need to be pointed in the right direction. I'm trying to map a railcar's route based on a shapefile of the railroad lines in America.

What I have:

1) I have a file containing specific railcar's routing. Railcars have Radio Frequency ID tags (RFID) that are scanned when entering a rail yard. This file contains all these scanned entry points as well as Lat/Log data for the yard.

2) I have a shapefile of all railroads in America.

My Problem:

I want the path of the railcar to follow the railroad shapefile exactly. If I just tried to map the Railcar file, it would show direct lines from one yard to another, and would not follow the actual path of the railroad. How do I do this? Again, I'm just looking to be pointed in the right direction.

Jay Guarneri
  • 2,105
  • 1
  • 16
  • 33
Josh
  • 41
  • 2

3 Answers3

3

What you want is network analysis. You can access the GRASS network analysis tools through Quantum GIS. What it does is allow you to calculate and model travel and cost of travel (time, distance, money, etc.) restricted along paths called edges. In your case, the railways would be the edges. If you have access to ArcGIS with Network Analyst, the tools are a bit easier to use, but you can get everything you need done with GRASS GIS.

Edit: Here is a link to a paper about network analysis in GIS.

Jay Guarneri
  • 2,105
  • 1
  • 16
  • 33
  • Thanks! It seems like this is really geared toward analyzing/selecting best travel patterns. I (think) what I'm trying to do should be easier. I just want plot a single railcar trip, but make sure the railcar path follows the railroad shapefile. Is there an easier option? – Josh Mar 27 '13 at 16:40
  • You could also try the QGIS road graph plugin if all you want to do is visualize the trip. This also uses network analysis, but is much simpler to use and only gives you a route. Effectively, it would calculate your railcar's shortest trip from point A to point B a la Google Maps or Mapquest. – Jay Guarneri Mar 27 '13 at 16:43
  • 1
    The problem with google maps or mapquest - They don't do railroad routes. I'm guessing this is the same problem with the road graph plugin. My end goal would be plot the exact path a railcar takes, and then calcuate the miles (based on lat/long of each point passed). – Josh Mar 27 '13 at 16:47
  • The road graph plugin will use whatever line file you feed it. In this case, you just need to tell it to use your railroads. It isn't actually using Google Maps or Mapquest, it will just calculate your route along the supplied railroads in the same way that these services calculate your directions along highways. The most likely hitch is going to be connectivity problems: if there are any erroneous gaps in your railroads, you might get some funny results. If you think you have that problem, look into Topology editing, (GRASS has some good tools for this). – Jay Guarneri Mar 27 '13 at 16:50
  • Ok, that actually looks like something i'd like to play around with. But the road graph will still give me the 'shortest route' when I really just need to plot an existing route and figure out the mileage. I want it to say railcar ABC traveled this route (plotted on map) which was 1,234 miles from origin to destination. – Josh Mar 27 '13 at 17:02
  • I think I can use Points to Paths plug-in and plot the railcar trip. But my problem still is how do I have the railcar path follow the railroad layer? – Josh Mar 27 '13 at 17:38
  • You could try running your network analysis one segment at a time, and pasting the results together. Also, the GRASS module v.net.salesman will route the shortest path between multiple points, so if you know all the rail yards it went through, just make a point file containing those locations and route it through the network. I don't know if v.net.salesman has any rules for enforcing the order in which stops are visited, though. – Jay Guarneri Mar 27 '13 at 17:59
  • 1
    great. That sounds like it may work. But if not I can search each segment at a time, like you said. But it may take me forever. – Josh Mar 27 '13 at 19:09
2

You could try my routing script for QGIS Processing based on the core network analysis library. It expects a point layer and a network layer as input and returns a route between the points.:

enter image description here

enter image description here

underdark
  • 84,148
  • 21
  • 231
  • 413
1

If you have the gis of rail lines you already have the length of the path of travel. You can just find the length in miles of the vector segments in question from beginning point ot end point. The data is already present. As far as routes from reader at yard Y to reader at yard X routing is done depending on the contract as presented by contract on the waybill which determines which carriers and routes loads and empties are to follow. Another words, routes for the same origin and desitnation can change. So the problem becomes what is the definition you want for your application, distance between yards along rail route or length per individual car route(s)?

lewis
  • 1,507
  • 10
  • 18
  • Right, but the car location messages (CLMs) of a specific railcar should give a good reference as to how the car will travel. There is not many times there would be multiple paths between yard Y and yard X on the same carrier. You will always receive a CLM before a car interchanges to another carrier, so not worried about interchanges either. And actually my routing i'm studing is UP direct, so no other carriers are required. – Josh Mar 27 '13 at 19:04
  • The variances in the routing is actually why I’m wanting to do this. Railroads calculate mileage for Fuel Sur Charge based on a predefined route (usually generated by PC* Miler) but if the actual routing is less on some cars? Then we should pay less FSC. – Josh Mar 27 '13 at 19:06
  • It depends if your data analysis is more accurate than the carriers than pc miler, whether other carriers accept your calculations, and what methods pc miler uses to generate it's results compared with what you may develop. – lewis Apr 03 '13 at 15:51