[OSM-talk] Reverse look-up gazetteer
marcus.wolschon at googlemail.com
marcus.wolschon at googlemail.com
Thu Mar 19 13:52:06 GMT 2009
On Thu, 19 Mar 2009 14:09:21 +0100, andrzej zaborowski <balrogg at gmail.com>
wrote:
> 2009/3/19 paul youlten <paul at yellowikis.org>:
>> Does anyone know if there is there a web service that lets me take the
>> latitude and longitude of a node and establish which country,
>> state/county/province, city and Zip/post code the node is in?
>
> I don't know of a specific web service but it turns out using the
> usual API you can find the city name quite easily, I first saw it done
> in the party render script:
> http://svn.openstreetmap.org/applications/rendering/party/render.py .
> The post code and other data you would have to pull from somewhere
> else as OSM doesn't store those except for a few places now.
Hello Andrezej,
I read the source-code and it just looks for a node with a place-tag
exists in a certain bounding box, expecting to find exactly one.
This will fail if:
* there are more then 1 place-nodes in the bounding box
* the city is too large the the node is not in the bounding-box
* the location does not belong to the city but the center of some village
is nearby
* the location is part of a place=hamlet or anything but "city", "village"
or "town"
It's also quite expensive to do a bbox-query like that for more then a few
locations.
So it's neither easy nor anywhere near reliable. It's just a quick hack
that
works in some cases.
Marcus
More information about the talk
mailing list