是否可以从HTTP请求获取(粗略)移动电话位置 [英] Is It Possible to get a (rough) Mobile Phone Location from a HTTP Request

查看:289
本文介绍了是否可以从HTTP请求获取(粗略)移动电话位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果内存正确地为我服务,Google会为地图网站执行此操作。我知道谷歌的移动地图应用程序可以确定粗略的位置(我假设使用某种手机信号塔查找),但我似乎记得在移动浏览器上观看时,该网站与当前位置有些接近。



任何人都知道如何/如果这是可能的? IP地址是否根据塔或区域而改变(看起来他们会使用某种通用运营商的网关)?

解决方案

使用常规的HTTP请求,您拥有的唯一选项是GeoIP,但这只会为您提供国家&运营商没有更好的。



根据应用程序&您正在使用的设备有多种地理定位选项,例如iPhone& Android浏览器支持HTML5 geo javascript功能,因此您可以在页面中放置一些代码以将位置发送给您。然而,这些都涉及到一些客户端代码。另一种选择涉及与网络进行交易,他们可以为您提供电话号码作为请求中的附加头,以及然后您可以通过运营商的API查询此号码以从网络获取手机的位置。然而,他们为这项功能收取了一分钱,准确度可以从城市环境中的约100m到非常农村地区的35km。

If memory serves me correctly, google does this for the maps site. I know google's mobile maps app can determine the rough location (I assume using some kind of cell tower lookup), yet I seem to remember the site getting somewhat close to the current location when viewing on a mobile browser.

Anyone know how/if that's possible? Does the IP address change based on the tower or area (seems like they'd be using some kind of gateway common to the carrier)?

解决方案

With a regular HTTP request the only option you have is GeoIP but this will only give you the country & operator no better.

Depending on the application & device you are using there are various option for geolocation, for example iPhone & Android browsers suport the HTML5 geo javascript functions so you could put some code in the page to send you the location. However these all involve some client side code.

The other option involves doing a deal with the networks, they can supply you the phone number as an additional header in the request and you can then query this number via an API from the operator to get the location of the phone from the network. However they charge a pretty penny for this function and the accuracy can vary from about 100m in an urban environment to 35Km in very rural areas.

这篇关于是否可以从HTTP请求获取(粗略)移动电话位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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