Forum Moderators: DixonJones

Message Too Old, No Replies

ip -> city or ip -> lat/long

geo ip

         

mactac

1:49 am on May 29, 2004 (gmt 0)

10+ Year Member



Is there a free database somewhere that I can download that will do an Ip to city conversion, or better yet, and ip to latitude/longitude? (i have the city->lat/long database, so i can always get that part of it myself).

There are a ton of people who charge for this info, but the source information sources are all free (apnic, etc). is there anyone providing this database?

I do have a ip->country database already...

thanks!

jatar_k

1:54 am on May 29, 2004 (gmt 0)

mactac

2:07 am on May 29, 2004 (gmt 0)

10+ Year Member



yes, i know how to use google :) I've spent hours on google looking

My post noted that I was looking for a free service....

I don't see any in your google search.

jatar_k

2:15 am on May 29, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well this one was recommended on php.net but it is to country

[ip-to-country.webhosting.info...]

mactac

2:34 am on May 29, 2004 (gmt 0)

10+ Year Member



ya, thanks, i already have that db (if anyone needs it...!)

i need to city or lat/long

jmccormac

3:06 am on May 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Mapping IP to city is often difficult especially in countries where the internet is still highly centralised in the major population areas. To go beyond the trivial IP>country mapping would involve mapping the IP networks of ISPs and access providers. While this is not a difficult task, the magitude of the task is quite staggering. What happens, as a direct result is that the people and companies that generate such mapping databases concentrate on the high payoff targets where there will be a chance of selling a decent number of copies of the database. The key word being "selling". :) The majority of the IP>country databases that I've seen are generated from the daily 'delegated' lists from the IP registries (ARIN, RIPE, APNIC, LACNIC etc). The city mapping would have to be done from the whois data and that is a somewhat more complex task than doing the simple IP>country code mapping.

The country code mapping is simple becuse the individual line from a registry's delegated list can be broken down simply:

ripencc¦IE¦ipv4¦193.29.52.0¦256¦20040330¦assigned

ripencc: is the IP registry.
IE: the country code for Ireland.
ipv4: An IPv4 address range
256: There are 256 addresses in this allocation 0-255
20040330: lastupdated on this date
assigned: assigned

The number of addresses can be larger than 256 and it frequently is at this level. The problem is where IP allocations are suballocated to individual users of the ISP/access providers. This is where the city stuff comes in because you have to dig deeper for every allocated IP. This generally involves access to the raw whois data and banging that data into a huge database. (From what I remember, the raw unprocessed data for the RIPE whois data is approximately 1G of text.) Then it is either a case of cross referencing the names of cities and towns over that database to produce something approaching an IP>city table.

It is a very complex task especially when you don't have ground-truth knowledge of the country you are trying to map. For example, Port Lairge and Waterford are the same city - Port Lairge is the Irish language name for the city. You've also got similar linguistic problems in some other multi-lingual European countries. Then there is the problem with outdated and incorrect data in the registry whois data.

Regards...jmcc

Laurel

10:46 pm on May 29, 2004 (gmt 0)

10+ Year Member



Here's the one I use
[geobytes.com...]