My application knows the IP address of the user. We need to identify the city, state, country of the user and latitude & longitude of the user.
Is there a java l
http://www.maxmind.com/app/developers provides a local database and java classes to calculate the location information from IP address. I did some testing. The results seem to be good.
bbc.co.uk: 212.58.241.131 : 51.283295,-0.23330688;Tadworth,N7,United Kingdom,null
home: 76.126.242.196 : 37.369705,-122.0214;Sunnyvale,CA,United States,94086
google.com: 74.125.224.133 : 37.419205,-122.0574;Mountain View,CA,United States,94043
tcs.in: 202.71.129.225 : 28.666702,77.216705;Delhi,07,India,null
ebay.com: 66.135.205.13 : 37.280304,-121.956696;Campbell,CA,United States,95008
etrade.com: 12.153.224.22 : 34.091797,-84.2209;Alpharetta,GA,United States,30005
whitehouse.gov: 72.247.136.110 : 42.362595,-71.0843;Cambridge,MA,United States,02142
Here is the link to the junit testcase I used, GeoLiteCityTest.java
MaxMind provides java classes, but not jars. So, I have created a maven project that can build the code and generate jars. Here is the GitHub Project https://github.com/snambi/GeoIP
If you need to use this library in your maven project, add the following dependency
org.geomind
geoip
1.2.8
Add the following repository configuration, under "repositories" in the pom.xml
geoip
http://snambi.github.com/maven/