-1

For example, there is a street looks like this (using Mapbox for map service).

a street

The street/road (marked as R-205 in the image) is a complex curve line. Now I want to get the coordinate list (latlngList) of this road. However, I found Mapbox doesn't provide the coordinate list of this street. Does anyone have any ideas about this?

Hanfei Sun
  • 45,281
  • 39
  • 129
  • 237
  • Take a look at the google Maps Direction Service. You have to set a Start/End Point and that Service will return you a list of waypoints along that road. – el solo lobo Feb 26 '16 at 07:15
  • If my prev reply is what your were searching for, I would post the code as an answer, but some feedback from your side is required. – el solo lobo Feb 26 '16 at 10:59
  • @Dev0x Thanks, but that is not what I need. Because I don't know the start/end points,. Only the street name is known. (The input is: Street Name, The output is: latitude/longitude coordinates of that street) – Hanfei Sun Feb 26 '16 at 11:40
  • Ok, the geolocation API could be a first step in right direction then. I´ve created an explanation for another question, guess that could help: http://stackoverflow.com/questions/35600754/how-to-use-address-instead-of-lat-long-in-google-map-api/35601336#35601336 Maybe that service response will contain the information you require, but I´m not sure. If I have some time, I will try it. – el solo lobo Feb 26 '16 at 11:57
  • FYI if you ever need a direction service, there's no need to turn to google since Mapbox has a perfectly good direction service of their own: https://www.mapbox.com/developers/api/directions/ – iH8 Feb 26 '16 at 17:53

1 Answers1

0

If you look at that road in OpenStreetMap, you'll see it highlighted. Read OSM's technical documentation to use its APIs to fetch individual geographical features, or download OSM data if you need road geometries for a larger area.

IvanSanchez
  • 18,272
  • 3
  • 30
  • 45