Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Train track route using Google Maps

I am wondering if it is possible to create a route on a map using a train track. I know its possible over normal roads.

like image 999
Paul Peelen Avatar asked May 20 '26 13:05

Paul Peelen


1 Answers

It's certainly possible. (Broadly speaking, everything is possible) :-)

The first thing you'd need is data on the location of the railroad tracks. For the US, Canada and part of Europe this is publicly available as shapefiles, for example at: http://www.lib.unc.edu/reference/gis/datafinder/index.html?search_type=show_category_contents&datalayers=1&category_id=109

Once you obtained the shapefiles all options are open. You can convert the lines to google.maps.polyline() objects, (or GPolyline() if you're using V2 of the API), and load them on a map. It will all depend on what you want to achieve and what server side languages you're using. Getting rail directions is a completely different matter. :-)

Marcelo.

like image 99
Marcelo Avatar answered May 23 '26 05:05

Marcelo