Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get user's location from IP address

 
Kevin Zhang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, there

I'm developing a location based service app. One function is to provide local information based on user's current area.

My question is :

How to get user's location with user's IP address? Any Java APIs ?


Kevin Z
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're in luck - an article in the JavaRanch Journal covered this.
 
Kevin Zhang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:You're in luck - an article in the JavaRanch Journal covered this.


Thanks, Ulf

I found the free solution is like "IP to country". What I really want is "IP to city".

For example, I want to tell the user is from NY according to his/her IP address.

BTW, Is there any vendor solution for this issue?

kevin

 
Maneesh Godbole
Saloon Keeper
Posts: 11027
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kevin Zhang wrote:
BTW, Is there any vendor solution for this issue?


Check out http://www.ip2location.com.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48954
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:
Kevin Zhang wrote:
BTW, Is there any vendor solution for this issue?


Check out http://www.ip2location.com.
It's only got my location wrong by 200 miles!
 
Rob Spoor
Sheriff
Pie
Posts: 20529
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's got my location wrong by an hour drive. Well, at least it got the country right
 
Steve Fahlbusch
Bartender
Posts: 605
7
Mac OS X Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mine was only 326 miles away.
 
Paul Clapham
Sheriff
Posts: 21107
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I tried one of those databases it got my country right, but it was still three time zones and around 5,000 kilometres off.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The city was correct for me.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48954
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mine varies; sometimes it is only 100 miles out. Always in the same general direction, so far.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want accuracy, you have to use the pay services. The free databases simply aren't as good.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even the pay services have limits. Especially in corporate environments. I worked at a company with offices in Dusseldorf Germany that had IP addresses (and networking) from the US. using the IP would have you be off by five or six time zones and an eight hour flight.

Its like phone numbers. In the olden days, you could use the area code and exchange to identify North American phone numbers to within 10 miles. Now, people keep their cell phone numbers, and you can't tell anything. Perhaps you can tell country or continent, but you can't tell much else.
 
priya uma
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi visit http://www.ip-details.com/ip-search/ here if you give the Ip address you can get the details about the location of that particular IP address like the country name ,ip location address,Latitude, Longitude etc...
i hope it will be helpful to you..........
 
Henry Wong
author
Marshal
Pie
Posts: 21117
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
priya uma wrote:Hi visit http://www.ip-details.com/ip-search/ here if you give the Ip address you can get the details about the location of that particular IP address like the country name ,ip location address,Latitude, Longitude etc...
i hope it will be helpful to you..........


Being from NYC, most IP locators seems to get it right. I guess cities, especially famous ones, get the data online first. So far, the bad ones report the location as New York City. And the good ones get it closer to the borough of Queens, locating to either Jamaica or Richmond Hill, which I guess, is close enough (only a few miles off).

This one however, put my location as Herndon Virginia, to the exact address of the headquarters of my cable provider. This address is more than 250 miles away, definitely not in New York City, definitely not in New York State, but got the country right.

Henry

 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:put my location as Herndon Virginia, to the exact address of the headquarters of my cable provider.


And without knowing which is your provider, I can be sure that its not really in Herndon VA either. Herndon was a small farming market town when I was a kid. There are office buildings with many corporate HQ there now, but its really just the only post office on the 10+ lane freeway out to Dulles Airport.

Most of the big Internet companies are actually between Herndon and the airport. There is no real name, because in 2000, it was just farmland. That is where AOL built their huge headquarters and where MCI built a monster datacenter. Its also where Equinix has its series of monster co-lo facilities, which host servers for minor companies like Amazon, Yahoo, etc. Sometimes this area is labeled as "Ashburn" but its really nameless.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic