为什么不同的请求使用Google地理位置api返回相同的地理位置 [英] Why different requests return same geolocation with google geolocation api

查看:132
本文介绍了为什么不同的请求使用Google地理位置api返回相同的地理位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我向Google地理位置api发送了两个请求:
https://www.googleapis.com/geolocation/v1/geolocate?key= [mykey]



<第一次请求:
$ b


{Carrier:T-Mobile,CellTowers:[{Age:0, CELLID: 39627456, LocationAreaCode: 40495, MobileCountryCode: 310, MobileNetworkCode: 260, SignalStrength: - 95 timingAdvance:0}], HomeMobileCountryCode :310,HomeMobileNetworkCode:260,RadioType:gsm}

第二次请求:


$ b


{Carrier:T-Mobile,CellTowers:[{Age:0,CellId:4912, LocationAreaCode: 20516, MobileCountryCode: 460, MobileNetworkCode: 00, SignalStrength: - 60 timingAdvance:55555}], HomeMobileCountryCode: 460, HomeMobileNetworkCode :00,RadioType:gsm}


奇怪的是他们都返回相同的地理位置


{location:{lat:39.90403,lng:116.407526},
准确性:18000.0}


任何人都知道为什么会发生这种情况?
是Google地理位置数据库的错误吗?
我怎么才能得到(大量真实的)测试数据?

试着去除数字,我没有这个API的关键,但它可能是它。



例如您的第一个请求:


{Carrier:
T-Mobile,CellTowers:[{Age:0,CellId:39627456,LocationAreaCode 40495, MobileCountryCode:310, MobileNetworkCode:260, SignalStrength: - 95 timingAdvance:0}], HomeMobileCountryCode:310, HomeMobileNetworkCode:260, 无线电电传打字机: GSM}



I send two requests to google geolocation api: https://www.googleapis.com/geolocation/v1/geolocate?key=[mykey]

1st request:

{"Carrier": "T-Mobile","CellTowers":[{"Age":0,"CellId":"39627456","LocationAreaCode":"40495","MobileCountryCode":"310","MobileNetworkCode":"260","SignalStrength":-95,"timingAdvance":0}],"HomeMobileCountryCode":"310","HomeMobileNetworkCode":"260","RadioType":"gsm"}

2nd request:

{"Carrier":"T-Mobile","CellTowers":[{"Age":0,"CellId":"4912","LocationAreaCode":"20516","MobileCountryCode":"460","MobileNetworkCode":"00","SignalStrength":-60,"timingAdvance":55555}],"HomeMobileCountryCode":"460","HomeMobileNetworkCode":"00","RadioType":"gsm"}

The weird thing is both of them return same geolocation

{ "location": { "lat": 39.90403, "lng": 116.407526 }, "accuracy": 18000.0 }

Anyone know why this happen? Is a bug of google geolocation database? how can I got (lots of real) testing data?

解决方案

Try to remove the quotes "" around the numbers, I don't have an API key for this one, but it might be it.

For example your first request:

{"Carrier": "T-Mobile","CellTowers":[{"Age":0,"CellId":39627456,"LocationAreaCode":40495,"MobileCountryCode":310,"MobileNetworkCode":260,"SignalStrength":-95,"timingAdvance":0}],"HomeMobileCountryCode":310,"HomeMobileNetworkCode":260,"RadioType":"gsm"}

这篇关于为什么不同的请求使用Google地理位置api返回相同的地理位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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