[OSM-dev] Reverse geocoding - nearest nodes vs areas
David Earl
david at frankieandshadow.com
Mon Aug 10 23:34:54 BST 2009
Michael Handerek wrote:
> Hi,
>
> I played a little bit with different ideas and concepts to realize a
> reverse geocoding tool. I also found some existing implementations like
> the namefinder and the navigation subsystem of traveling sales man. I
> noticed that all solutions search for tagged nodes and ways in specified
> max. distance.
>
> In my opinion, checking if a point is part of an area geometry is more
> precise than setting a marginal distance for the nearest tagged nodes,
> isn't it? But what about the performance aspect, nearest node vs area?
It's only recently that we have had any areas worth testing against.
Even now, most places don't have an area - they're mostly regional
things like counties. So street in town isn't ready to go with area
tests anywhere near yet.
It also depends what question you're asking: street in a place 99% of
the time gets the right answer by proximity.
Point in area tests are much, much more expensive, and they don't lend
themselves to database queries. It almost certainly would need
preprocessing to mark named objects with their containing areas not
on-the-fly queries.
Finally, you don't always want geometric precision in searches.
Flexibility is good sometimes. For example my address ends with
Cambridge, but I don't actually live in Cambridge, so being too pedantic
about Cambridge would exclude helpful results from a search.
David
More information about the dev
mailing list