I'm trying to use Nominatim to get the Lat/Long for GB Postcodes and struggling. To avoid pounding on OpenStreetMaps's servers I've setup my own Nominatim with the gb_postcode_data but it doesn't seem to get used. If I query like so: wget -O - -q "http://mynominatim.somewhere/search?format=xml&postalcode=KA2 9AE&country=gb" I get no result (same result if I use nominatim.openstreetmap.org for the above query). wget -O - -q "http://mynominatim.somewhere/search?format=xml&postcode=KA2 9AE&country=gb" I get no result (using nominatim.openstreetmap.org I get a place in the Lake District returned). wget -O - -q "http://mynominatim.somewhere/search?format=xml&q=KA2 9AE&country=gb" Returns a place in Wales but the KA2 9AE postcode is in Dundonald, Scotland (the same query on nominatim.openstreetmap.org returns no result). However using "PE8 6XH" as the postcode in the above query I get sensible results from both the official and my nominatim. Huh? I've checked and "KA2 9AE" is in the gb_postcode_data.sql.gz file so why's it not being used? Why the different results from 'my' nominatim and the official one? I'm probably doing something stupid but I can't work out what. Enlightenment would be greatly appreciated. asked 14 Jan '15, 11:36 ruffle |
If you just want postcode centroids, then Nominatim is probably not the best tool for the job. You can download the centroids for free from Ordnance Survey's OpenData initiative, which will be much more complete than the equivalent data in OSM. answered 14 Jan '15, 18:22 Richard ♦ |
The result you are getting for the 2nd query is simply the centroid for the GB admin boundary polygon. What I know about nominatim the postcode support is minimal and likely you should be asking the developers directly (aka opening an issue).
Thanks for the advice, new issue opened:
https://github.com/twain47/Nominatim/issues/221
When I get an answered I'll update this page.