IPMap – Geocoding Multiple IP Addresses using OpenStreetMap

If you are looking for methods to map IP address to their geographic locations, there are various possibilities (source):

Some of them provide geo data to be downloaded, others, such as Google Maps, allow data retrieval via a web service.

Of course, the drawback of 3rd party web services is that access is usually metered, meaning the number of requests per day or per hour is limited, especially for free web services (e.g. Google Maps usage limits).

After checking which of the services gave me the most accurate location for my IP address, I chose MaxMind GeoLite City as my geo data source, downloaded the .csv files, and imported them into a database. The resolution is on IP blocks per city, which is good enough for my purposes.

From a previous project operating with OpenStreetMap and OpenLayers,  I employed an elaborate technique of code reuse (read: copy and paste and edit) to adapt the existing code to its new purpose.

And voilà, here comes IPMap.

The text box allows any text to be entered, and the code-behind extracts the IP addresses contained in the text (great if you just want to paste lines from server log files). Processing the request may take some time depending on the number of IP addresses posted.

By the way, the screen shots of my previous post are actually the output of IPMap.

Sample: Hits on this blog from Feb 01 through Feb 03

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.