如何从 GPS 坐标获取道路名称或街道名称?
How to get road name or street name from GPS coordinates?
有没有可能在给定GPS坐标的情况下得到道路名称或街道名称?我正在开发一个 android 应用程序,用于向驾车前往事故现场的道路使用者提供即将发生的道路事故信息。因此,我需要识别在事故发生的同一路线上行驶的道路使用者。因此,我将每 500 米获取道路使用者的当前位置。所以我需要将这个 GPS 位置与道路地址进行映射,并检查道路使用者是否驶向事发地。
如果有任何可能的方法,请告诉我。我是地图的初学者。
您最好的选择可能是使用已经存在的 API,例如 Google 的 Reverse Geocoding。
它 returns 相当有前途的数据,一个例子(来自文档)是:
results[0].formatted_address: "277 Bedford Ave, Brooklyn, NY 11211, USA"
results[1].formatted_address: "Grand St/Bedford Av, Brooklyn, NY 11211, USA"
results[2].formatted_address: "Williamsburg, Brooklyn, NY, USA"
results[3].formatted_address: "Brooklyn, NY, USA"
results[4].formatted_address: "New York, NY, USA"
results[5].formatted_address: "Brooklyn, NY 11211, USA"
results[6].formatted_address: "Kings County, NY, USA"
results[7].formatted_address: "New York-Northern New Jersey-Long Island, NY-NJ-PA, USA"
results[8].formatted_address: "New York Metropolitan Area, USA"
results[9].formatted_address: "New York, USA"
否则,为此编写自己的实现将非常重要(但可能非常有趣)。
有没有可能在给定GPS坐标的情况下得到道路名称或街道名称?我正在开发一个 android 应用程序,用于向驾车前往事故现场的道路使用者提供即将发生的道路事故信息。因此,我需要识别在事故发生的同一路线上行驶的道路使用者。因此,我将每 500 米获取道路使用者的当前位置。所以我需要将这个 GPS 位置与道路地址进行映射,并检查道路使用者是否驶向事发地。 如果有任何可能的方法,请告诉我。我是地图的初学者。
您最好的选择可能是使用已经存在的 API,例如 Google 的 Reverse Geocoding。
它 returns 相当有前途的数据,一个例子(来自文档)是:
results[0].formatted_address: "277 Bedford Ave, Brooklyn, NY 11211, USA"
results[1].formatted_address: "Grand St/Bedford Av, Brooklyn, NY 11211, USA"
results[2].formatted_address: "Williamsburg, Brooklyn, NY, USA"
results[3].formatted_address: "Brooklyn, NY, USA"
results[4].formatted_address: "New York, NY, USA"
results[5].formatted_address: "Brooklyn, NY 11211, USA"
results[6].formatted_address: "Kings County, NY, USA"
results[7].formatted_address: "New York-Northern New Jersey-Long Island, NY-NJ-PA, USA"
results[8].formatted_address: "New York Metropolitan Area, USA"
results[9].formatted_address: "New York, USA"
否则,为此编写自己的实现将非常重要(但可能非常有趣)。