views:

230

answers:

5

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

+2  A: 

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.

this. __curious_geek
Just to respond to the line in bold: there are uses of location where imprecise or approximate locations are sufficient. If I want to guess a time zone, show the user nearby weather conditions, choose the country-specific version of my website, or any number of other tasks, I don't need anything like GPS-precision. How approximate the locating method can be will depend on your use case, but there are a wide variety of use cases.
npdoty
It seems to me that google is known for 'triangulating' location from cell towers. When I first saw it done on a BlackBerry (a few years back), it was relatively close - enough for some purposes. What I'm trying to determine is if that's somehow possible simply by analyzing the HTTP request. I'd seem rumors of the Kindle having a rough location viewing google maps (web not app).
Tim Lytle
+1  A: 

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.

Sam Machin
+1  A: 

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.

sam ozluk
+1  A: 

You have Google API Documentation on this:

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

Hope it helps...

confiq
+1  A: 

Hi Tim- 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/

Kevin
Have use mindmax before, but not recently - thanks.
Tim Lytle