How can I find the nearest intersection via the Google Maps API?

前端 未结 2 1413
傲寒
傲寒 2021-01-12 05:19

How can I find the closest intersection of the street I have coordinates of?

For instance, say I have street A running from south to north that is crossed by street

相关标签:
2条回答
  • 2021-01-12 05:54

    [see comments above]

    unfortunately, no. even with gdirections, there is no way to locate the beginning and end of the street (coordinates). I have solved it by using the hack proposed above: looping over building numbers from 1 to XXX.

    if accuracy is 6 for a while (8 = building number, 7=intersection, 6 = approximate address only) that means no new numbers exist. so i just take first point (lat/long), middle one and the last one (all with accuracy 8) and create path between them. this however sometimes only provides only a part of the street as other parts are either without any buildings or google does not have further data :(

    0 讨论(0)
  • 2021-01-12 05:59

    You might consider using the TIGER data from the USGS. You can get that information from there, but it's not as easy to play with as the Google data.

    0 讨论(0)
提交回复
热议问题