That’s right, in our present world where questions like “What is on your mind?” or “What are you doing?” are already getting old, the next big wave, even in social networks is “where are you?” Facebook, Foursquare, and Gowalla are just some of the services that are revolutionizing the location-based services including the hundreds of apps that run on both Android and iPhone platforms.
Why determining your geographic location?
By determining your geographic location by use of the IP address, it is possible to offer more localized services and allow you to enjoy a much fuller user experience, especially when using localized services like those mentioned above. Some common applications for geolocation by IP include chat programs, Weblogs and other distributed computing environments where location data is used to provide a local experience.
Almost all modern browsers today support the geolocation feature, which is the ability to track your location and by extension offer location-based services.
How does it work?
The geolocation feature: tracking your location
Inspecting the geolocation data usually brings up a number of important details. For one, it will denote the time at which the geolocation data instance was created. A set of geographic coordinates together with their associated accuracy and other optional attributes will be displayed. Knowing this information exists will help you better determine if it is wise to allow applications to track your location or restrict access to your location. In addition, if your target device supports it, you can access some of this information and determine how you are being tracked.
For those browsers that do not support geolocation, there is always the option of using large geolocation databases to map the IP address of a device. This method however usually suffers from the fact that the IP addresses may be wrongly associated with a location, it could provide a very broad geographic area results without street or latitude/longitude locations or some addresses simply do not exist on the databases making the location untraceable. When GPs or triangulation is not available, however, these external geolocation services provide a good fallback.
How can you use the IP address geolocation to provide localized services?
To implement this on a website or an application, you can use PEAR system which comes with a PHP package that can assist in retrieving such information. Alternatively, the PERL module can also be used. Another useful geolocation resource is the DNS LOC. This resource provides a means for expressing location information in the Domain Name System. This is done by adding the server location information on the DNS registration page. The use of DNS LOC makes it easy for applications to use this information without having to do any extra work. In addition, it allows location-based services to estimate your location based on ping times and traffic even where the signal has been bounced to the second or third server.
To help geolocation by IP address, some service providers associate the dynamic IP addresses of users to an internal naming scheme that they keep and then shortening this information to some name like a12-55-1-00.try.hereiam.com. Some resources can then be used to decipher the country code, associated city and the region of the city. One of these is the GNS (GEOnet Names Server).
If you are uncomfortable using location-based services that track your IP, you can always use a proxy or simply disable the service on your end.