1 # Postcodes in Nominatim
3 The blog post [Nominatim and Postcodes](https://www.openstreetmap.org/user/lonvia/diary/43143)
4 describes the handling implemented since Nominatim 3.1.
6 Postcode centroids (aka 'calculated postcodes') are generated by looking at all
7 postcodes of a country, grouping them and calculating the geometric centroid.
8 There is currently no logic to deal with extreme outliers (typos or other
9 mistakes in OSM data). There is also no check if a postcodes adheres to a
10 country's format, e.g. if Swiss postcodes are 4 digits.
13 ## Regular updating calculated postcodes
15 The script to rerun the calculation is
16 `build/utils/update.php --calculate-postcodes`
17 and runs once per night on nominatim.openstreetmap.org.
20 ## Finding places that share a specific postcode
22 In the Nominatim database run
25 SELECT osm_type, osm_id, class, type,
26 st_x(centroid) as lon, st_y(centroid) at lat
28 WHERE country_code='fr'
29 AND upper(trim (both ' ' from address->'postcode')) = '33210';
32 Alternatively on [Overpass](https://overpass-turbo.eu/) run the following query
35 [out:json][timeout:250];
36 area["name"="France"]->.boundaryarea;
38 nwr(area.boundaryarea)["addr:postcode"="33210"];