Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of bus stops from Google Maps

I am trying to build web app where you input your address and it will give you list of bus stops in your area. I want to use Google Maps for this, but i can't find the way to use them for this. Is there any way to get list of points on maps in, lets say, JSON or XML format? I tried Google Maps Places API, but it didn't work this way. Only thing i found is this example - http://gmaps-samples-v3.googlecode.com/svn/trunk/localsearch/places.html but thats not what i need.

So, anyone knows?

like image 393
Pirozek Avatar asked Aug 21 '11 15:08

Pirozek


1 Answers

The Google Places API does have stop information on there but you need to form your query very specifically to make it work.

The key is using the nearby search with rankby=distance and radius= and types=bus_station

The default rankby prominence rarely shows bus stations.

Sample query:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=49.89458,-97.14137&sensor=true&key=your_key&rankby=distance&types=bus_station

like image 81
Tyler Avatar answered Sep 22 '22 19:09

Tyler