google-maps - 如何获得与 Google Map Geocoder V3 相当的精度

标签 google-maps geocoding google-api

我想从 google 获取地理编码,我以前是使用 API 的 V2 来实现的。 Google在json中发送了一个相当不错的信息,准确率很高,引用这里:http://code.google.com/intl/fr-FR/apis/maps/documentation/javascript/v2/reference.html#GGeoAddressAccuracy

在 V3 中,Google 似乎没有向我发送完全相同的信息。有一个数组“adresse_component”,如果精度更好,它看起来更大,但不完全一样。 例如,我请求精确到街道号码,数组大小为 8。 另一个查询是路线的准确性,因此准确性较低,但数组的大小仍然是 8,因为有一行“sublocality”,这在第一种情况下没有出现。

好的,对于结果,Google 会发送具有“最佳”准确性的数据“类型”。此类型在这里:http://code.google.com/intl/fr-FR/apis/maps/documentation/geocoding/#Types 但是,没有真正的顺序,如果我不希望结果比 postal_code 更好,我不知道如何做到这一点。

那么,我怎样才能获得相当于 V2 精度的结果,而不需要一些愚蠢而可怕的代码呢?

最佳答案

嗯,有 location type ,这还不错:

location_type stores additional data about the specified location. The following values are currently supported:

"ROOFTOP" indicates that the returned result is a precise geocode for which we have location information accurate down to street address precision.

"RANGE_INTERPOLATED" indicates that the returned result reflects an approximation (usually on a road) interpolated between two precise points (such as intersections). Interpolated results are generally returned when rooftop geocodes are unavailable for a street address.

"GEOMETRIC_CENTER" indicates that the returned result is the geometric center of a result such as a polyline (for example, a street) or polygon (region)."

"APPROXIMATE" indicates that the returned result is approximate.

我测试了 location_type 是否与近似值不同,它给出了一些不错的结果。

关于google-maps - 如何获得与 Google Map Geocoder V3 相当的精度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3015370/

相关文章:

javascript - 从单独页面加载的 JQuery UI 对话框中的 Google 图表

javascript - 如何从谷歌地图链接中提取坐标(PHP 或 Javascript)

javascript - gmappanel 移动到标记坐标 - EXTJS 4

iphone - 如何在 iPhone 上使用谷歌地图进行反向地理编码

ios - geocodeAddressString 不适用于某些地址

ios - GoogleAPI PanoView StreetView Bug - 图像加载不正确

php - 支付 API 权限被拒绝

android - Google maps Places API 附近搜索自动签到

javascript - 如何在 Vaadin 7 中使用 javascript 组件内的图像

javascript - 如何按城市或​​ bbox 限制 Leaflet-control-geocoder 结果?