如何在 Google Map Geocoder V3 中获得等效的准确度 [英] How to get the equivalent of the accuracy in Google Map Geocoder V3

查看:29
本文介绍了如何在 Google Map Geocoder V3 中获得等效的准确度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从 google 获取地理编码,我以前是用 API 的 V2 来做的.谷歌在json中发送了一个很好的信息,准确性,参考这里:http://code.google.com/intl/fr-FR/apis/maps/documentation/javascript/v2/reference.html#GGeoAddressAccuracy

I want to get geocode from google, and I used to do it with the V2 of the API. Google send in the json a pretty good information, the accuracy, reference here : http://code.google.com/intl/fr-FR/apis/maps/documentation/javascript/v2/reference.html#GGeoAddressAccuracy

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

In V3, Google doesn't seem to send me exactly the same information. There is the array "adresse_component", which seem bigger if the accuracy is better, but not exactly. For example, I have a request accuracy to the street number, the array is of size 8. Another query is accuracy to the route, so less accuracy, but the array is still of size 8, as there is a row 'sublocality', which not appear in the first case.

好的,对于一个结果,谷歌发送了一个数据类型",它具有最佳"的准确性.这些类型在这里:http://code.google.com/intl/fr-FR/apis/maps/documentation/geocoding/#Types但是,没有真正的顺序,如果我不想得到比 postal_code 更好的结果,我不知道该怎么做.

Ok, for a result, Google send a data 'types', which have the 'best' accuracy. This types are here : http://code.google.com/intl/fr-FR/apis/maps/documentation/geocoding/#Types But, there is no real order, and if I wan't the result better than postal_code, I have no clue to how to do that.

那么,我怎样才能在没有一些愚蠢而可怕的代码的情况下获得与 V2 相当的准确度?

So, how can I get this equivalent of the V2 accuracy, whithout some dumb and horrible code ?

推荐答案

嗯,有 位置类型,还不错:

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"表示返回的结果反映了一个近似值(通常在道路上)在两个精确的点(例如交叉点).插值结果一般为当街道地址的屋顶地理编码不可用时返回.

"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 是否与近似值不同,并给出了一些不错的结果.

I test if the location_type is different of approximate, and it gives some good results.

这篇关于如何在 Google Map Geocoder V3 中获得等效的准确度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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