Why different requests return same geolocation with google geolocation api

孤人 提交于 2020-01-14 18:50:26

问题


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?


回答1:


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"}



来源:https://stackoverflow.com/questions/20484392/why-different-requests-return-same-geolocation-with-google-geolocation-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!