Google Maps API - 获取街道坐标 [英] Google Maps API - Getting Street Coordinates

查看:46
本文介绍了Google Maps API - 获取街道坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google Maps API 有没有办法获取某个位置的街道坐标?

Google Maps API has any way to get the street coordinates of an location?

很简单:我只想得到最近的街道坐标.为了得到这个,我需要,例如,构成一条街道的所有坐标.

Is simple: I just want to get the nearest street coordinate. To got this i need, for example, all coordinates that compose a street.

有这样的吗?

推荐答案

这些答案都是旧的,自从有了答案,Google 已经对地图 API 进行了重大的重新排列.在 2018 年,将位置(long、lat)变成道路上的点"的最佳方法是使用 snap-to-road 或最近道路服务:https://developers.google.com/maps/documentation/roads/snap

These answers are all old, and Google has rearranged the maps API significantly since the answers. In 2018, the best way to turn a location (long, lat) into a "point on road," is to use the snap-to-road or nearest-road service: https://developers.google.com/maps/documentation/roads/snap

请注意,此 API 对每次 API 调用收取 1 美分,并且每次调用最多可收取 100 个不同的积分.如果延迟和复杂性都不是问题,如果您需要在客户端上回答这个问题,您可以构建一个服务器,最多收集来自不同客户端的 100 个请求,向 Google 发出一个请求,然后将请求数据返回给合适的客户.(对于此用途,请确保使用最近的道路,而不是快速到达道路.)

Note that this API charges a cent per API call, and can take up to 100 distinct points per call. If latency and complexity aren't problems, if you need to answer this question on a client, you could build a server that collects up to 100 requests from different clients, makes one request to Google, and then returns the request data back to the appropriate clients. (For this use, make sure to use nearest-road, not snap-to-road.)

此外,目前,Google Maps 提供每月 200 美元的对帐单信用额度,这可能会使此 API 的较小使用量实际上最终不会花费太多(或根本不会花费太多).

Also, currently, Google Maps has a $200 per-month statement credit available, which may make smaller uses of this API not actually end up costing much (or anything at all.)

这篇关于Google Maps API - 获取街道坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆