Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get street graph for a game using Google Maps API

I'm a total newbie to the Google Maps API and I want to develop a game that will use streets on google maps as the paths. I know pretty well what I need, but I don't even know what to begin searching for in the API docs...

How can I get something like a graph representation for the streets in a city or other portion of a google map - something like vertices for intersection and street names for edges (or anything that I can convert to something like this), with the vertices mapped to (lat, long) coordinate points ...or even the Polyline objects for the streets so I can extract what I want from them? (the route finding algorithm surely has access to a data structure like this, so it's in there somewhere, but how do I get at it through the API?)

If anyone has tried to write something like a custom route finding app based on Google Maps, he probably went through the step of getting this king of data out of the API, so please share the solution to this if you've already figured it out...

like image 511
NeuronQ Avatar asked Nov 22 '12 14:11

NeuronQ


1 Answers

Street data is not available through the API except as it appears in the output of the directions service. To get the bulk data you seem to be asking about for your use, you will need to find another source, depending on country, it may be freely available; or you might be able to get what you need from OpenStreetMaps.

like image 97
geocodezip Avatar answered Oct 11 '22 00:10

geocodezip