8

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...

NeuronQ
  • 7,527
  • 9
  • 42
  • 60

1 Answers1

6

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.

geocodezip
  • 158,664
  • 13
  • 220
  • 245
  • 2
    ...really??! ...why would they bother keeping this to themselves, it's not like it's *that hard* to write a program that extracts such data even from the generated .png tiles with basic image processing? (...well, yeah, "basic" would mean beyond the time/budget allocated for my tiny game but still, easily doable..) – NeuronQ Nov 22 '12 at 17:14
  • 2
    The data is (or at least was until recently) licensed from third parties. Scraping the data is against the terms of use. – geocodezip Nov 22 '12 at 17:18
  • As @geocodezip mentioned, OpenStreetMaps is what you want. Right on the site you can find the "export" function that allows you to download as a .osm file which represents a rectangular city block that has all the data you're looking for in a very readable and intuitive xml format. – ds-bos-msk Apr 09 '19 at 15:29