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