GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Trouble finding nearby city for latitutde/longitude  XML
Forum Index -> General
Author Message
qmnonic



Joined: 09/05/2008 16:00:54
Messages: 1
Offline

I'm having trouble finding the nearest city for a given latitude/longitude. I have tried a number of different queries, but can't seem to get it right. Here is an example...

Latitude: 40.7173387333125
Longitude: -73.9941215515137
Visually, this is in the heart of New York City. I'm looking for a query that returns the nearest CITY for a specific LAT/LONG.

http://ws.geonames.org/findNearbyPlaceName?lat=40.7173387333125&lng=-73.9941215515137
--- returns 'Allen Turnkey Housing'

Same query using the following fcode =
PPLX returns 'China Town'
PPLC returns nothing.
PPLA returns nothing.
PPL returns 'Allen Turnkey Housing'
PPLL returns 'Meat Packing District'
PPLS returns nothing.

Half the lat/longs within NYC return the city, half return something more specific (as noted above)... Is there a way to consistently return the nearest city? In the case above, it would always be NYC?


Thanks,

Matt.
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

Hi Matt

The problem, unfortunately, is anything else than trivial and I fear there is no easy and global solution.

For the US the street level data from the US Census might give better results :
http://ws.geonames.org/findNearestAddress?lat=40.7173387333125&lng=-73.9941215515137

Or probably better even the nearby postal codes :
http://ws.geonames.org/findNearbyPostalCodes?lat=40.7173387333125&lng=-73.9941215515137
The postal code solution also has the advantage that it works for many countries (ca 50).

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team