ariya.io About Talks Articles

geocoding based on IP address

1 min read

Given an IP address, there are different ways to obtain the approximate location: online web service or offline database. It is far from perfect, but it is very useful to give some initial guess before locking into GPS signals or using WiFi-based tracking.

Today’s example for X2 is actually an old code lying around which does the former: relying on IpInfoDB web service to guess where your computer is. Combined with the previous example, MapSnap, the guessed position is used to center the shown map (OpenStreetMap, of course).

Of course, as with other examples, it works fine on Maemo-powered Nokia N900 as well. Feel free to give it a try on Symbian or other supported Qt platforms.

The code is found in the usual X2 repository, under the sensor/ipgeocoder subdirectory.

For completeness’ sake, let me mention also that Matteo did something similar, using hostip.info and Google Maps via QtWebKit.

Related posts:

♡ this article? Explore more articles and follow me Twitter.

Share this on Twitter Facebook