GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Algorithm behind Find nearby place name / reverse geocoding  XML
Forum Index -> FAQ - frequently asked questions
Author Message

Joined: 04/07/2007 16:35:28
Messages: 1

Hi there.

First and foremost thanks so much for providing this data.

I know the server side src code is sadly not available, but would you mind outlining the algorithm you use to get the results for the "Find nearby place name / reverse geocoding" function?

I need to implement this myself as we cannot call the webservice.

Any pointers appreciated.


Joined: 30/10/2007 09:57:37
Messages: 5

Hi, look there:

Joined: 22/04/2009 07:00:09
Messages: 4

The algorithm for reverse geocoding, or finding the nearest location point of interest, seems to be a long outstanding question. I don't think "use a geo-database" is the right answer. Poster is asking for the algorithm, not the implementation.

Here is one potential solution: Do a sinusoidal projection of the lat/lon points for the POI database. This projection effectively allows you to treat the projected coordinates as being on a Cartesian plane. Next, build a kd-tree with the projected coordinates. Search the kd-tree to find the nearest point of interest. In place of the kd-tree, you can also use a database (no need for one with geo features), and simply do a (x>a) and (x<b) and (y>c) and (y<d) to find POIs close to the target point.


Joined: 30/10/2007 09:57:37
Messages: 5

Hey, ok thats too far complicated...

Try this:
- One GPS Second is about 15 meters distance
- calculate a rough estimated distance of your radius as gps seconds
- do a lookup for all nearby places lying nearby in my rough radius
- run through that list and calculate exact distance with great circle distance algo from haversine
- is the place in range, copy to new list
- use the new list with all nearby places
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team