X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/d3d07128b2050f2268f76c6f71ddcd1c3bdc42e2..48be8c33ba3da6934faccd87702337caf67f69d1:/docs/develop/Postcodes.md diff --git a/docs/develop/Postcodes.md b/docs/develop/Postcodes.md deleted file mode 100644 index 343b8de3..00000000 --- a/docs/develop/Postcodes.md +++ /dev/null @@ -1,45 +0,0 @@ -# Postcodes in Nominatim - -The blog post -[Nominatim and Postcodes](https://www.openstreetmap.org/user/lonvia/diary/43143) -describes the handling implemented since Nominatim 3.1. - -Postcode centroids (aka 'calculated postcodes') are generated by looking at all -postcodes of a country, grouping them and calculating the geometric centroid. -There is currently no logic to deal with extreme outliers (typos or other -mistakes in OSM data). There is also no check if a postcodes adheres to a -country's format, e.g. if Swiss postcodes are 4 digits. - - -## Regular updating calculated postcodes - -The script to rerun the calculation is -`nominatim refresh --postcodes` -and runs once per night on nominatim.openstreetmap.org. - - -## Finding places that share a specific postcode - -In the Nominatim database run - -```sql -SELECT address->'postcode' as pc, - osm_type, osm_id, class, type, - st_x(centroid) as lon, st_y(centroid) as lat -FROM placex -WHERE country_code='fr' - AND upper(trim (both ' ' from address->'postcode')) = '33210'; -``` - -Alternatively on [Overpass](https://overpass-turbo.eu/) run the following query - -``` -[out:json][timeout:250]; -area["name"="France"]->.boundaryarea; -( -nwr(area.boundaryarea)["addr:postcode"="33210"]; -); -out body; ->; -out skel qt; -```