Is It Possible to get a (rough) Mobile Phone Locat

2019-01-26 10:36发布

问题:

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)?

回答1:

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.



回答2:

This is Not possible.

1.) Location By querying Network Details.

Even if you get the approximate location from an installed app by querying network or cell-id details, it'd not be that reliable. You won't be able to perform anything based on that approximate location.

2.) Location By querying IP.

Secondly, in one country, a single telco will have it geo-stationed GPRS or EDGE gateways and all devices on network are connected to internet with that gateway. So basically you can't rely on location details by IP, because that would be the IP of the Gateway and not the IP of device(in case of EDGE).

Ultimately, if you need to do anything that is based on the location, the location itself needs be precise and not approximate.



回答3:

We were using Google Gears for some time and that worked on Windows Mobile version 5.0 plus devices. Google recently stopped that service. Yahoo have now started something called Yahoo Fire Eagle. Sounds good, haven't yet checked it out. I dont have a Yahoo account, yet.



回答4:

You have Google API Documentation on this:

http://code.google.com/apis/gears/geolocation_network_protocol.html

Hope it helps...



回答5:

A little late in the day, but another option not mentioned is the MaxMind geo IP lookup. Enter an IP address and it will provide you with a location. There is free service (with simple API) that provides city level accuracy. There is also a more accurate database available for a fee. I have noticed during testing that there are multiple towers / IP addresses in urban areas and the MaxMind database is aware of these. You'll get location, plus the telco provider.

http://www.maxmind.com/