Using railroads for routeplanning

319 views
Skip to first unread message

Kasper

unread,
Sep 20, 2011, 4:48:40 PM9/20/11
to google-map...@googlegroups.com
Hi,
For a school project I want to make an interactive map which shows objects moving from point to point [station to station]
For the animation I want to use this as a base: http://www.kmcgraphics.com/google/
That, as you see, uses the roads from Google Maps to determine its route.

But now comes the tricky part: I want to use the railroads for planning and displaying routes, not the regular roads.
Is this possible?

If needed, I am willing to make a custom map with all the railroads traced and stations placed, if that is possible.
If you know how, please let me know!


BTW: I want to use the railroads from the maps from The Netherlands, if that makes any difference.

Rossko

unread,
Sep 21, 2011, 5:44:43 AM9/21/11
to Google Maps JavaScript API v3
> But now comes the tricky part: *I want to use the railroads for planning and
> displaying routes, not the regular roads.*
> *Is this possible?*

Yes, but it would be an ambitious project.
Google have the resources
http://www.google.com/maps?ie=UTF8&f=d&dirflg=r&hl=en&saddr=hague&daddr=amsterdam&ttype=dep&date=9%2F21%2F11&time=10%3A42am
but I don't think you can legally get at them the way you want.

Unless you can identify a rail trip planner that does what you want,
and permits you to mess with its results, you'd need your own dataset
of the rail network, in terms of links, stations and junctions, so
that you could run your own route planning engine against it.
Are you looking at timetable aspects or just physical routes?
Should you consider restrictions like freight-only lines or depots?
As rail networks are not as complicated as roads, it should be
possible to manually gather the data.

The animation part is trivial by comparison, just add the polyline
data representing the curly physical path of each link to your
dataset, and animate on that by developing from the example you've
described.

davie

unread,
Sep 21, 2011, 12:09:08 PM9/21/11
to Google Maps JavaScript API v3
Hi Kasper
I have looked at The Netherlands maps and their rail lines are
indicated in the same way as the UK grey/white lines.
You should be able to create polylines over these.
I have a list of about 400 railway stations in The Netherlands with
there coordinates if it is of help.
Regards Davie


On Sep 21, 10:44 am, Rossko <ros...@culzean.clara.co.uk> wrote:
> > But now comes the tricky part: *I want to use the railroads for planning and
> > displaying routes, not the regular roads.*
> > *Is this possible?*
>
> Yes, but it would be an ambitious project.
> Google have the resourceshttp://www.google.com/maps?ie=UTF8&f=d&dirflg=r&hl=en&saddr=hague&dad...

Kasper

unread,
Sep 28, 2011, 5:57:15 PM9/28/11
to google-map...@googlegroups.com
@Rossko:
My apologies for the late reply, I didn't get email notifications... [I do now :P]

I know about the way Google Maps currently plans routes using trains, but that just isn't what I need.
I am willing to make my own map's routes with polylines, but is it possible to only use those polylines for route planning?
That would really be awesome.
And how do I construct those custom maps?

I also just need those custom routes for physical routes, I can get the departure and arrival data from the database of the national train company, using their API: the NS API.

As for the animation: I haven't looked at the code of my link yet, but I got the sourcecode from the author, so I will soon.
I think they just plan a route and animate a marker or something. Probably not that hard.

@Davie:
Yeah!! That would really be awesome!
It would save me so much work!
Reply all
Reply to author
Forward
0 new messages