OpenStreetMap 标志 OpenStreetMap

CAP (postcodes) of Italy

Cascafico 于 2018年八月29日 以 English 发布 最后一次更新于2020年九月30日。

Abstract

Codici di Avviamento Postale (postcodes) are propriety of Poste Italiane S.p.A. Sometimes OSM mappers who love the completeness of data cannot get this codes from open sources.
The below procedure is a simple workaround, taking advantage of iPA (Public Administration index) OpenData which lists widespread public offices in Italy.

Getting data

Go to iPA site and download “Amministrazioni” file. Here you can read when it was last updated.

Filtering data

On downloaded file, run:
$> awk –field-separator=”\t” ‘{ print $3”,”$6 }’ amministrazioni.txt | sort -u > CAP.csv
The command above takes TAB-separated columns 3 and 6 (municipality and postcode), sorting uniques and writes a comma-separated file.

Alternatively, you can switch columns for postcode sorting:
$> awk –field-separator=”\t” ‘{ print $6”,”$3 }’ amministrazioni.txt | sort -u > CAP.csv

Multi postcode municipalities:

Some cities have more than one postcode: it could be someway useful listing public office addresses (column 10) to approximately identify the area:
$> awk –field-separator=”\t” ‘{ print $3”,”$6”,”$10 }’ amministrazioni.txt | sort -u > CAP.csv

Take a look

To count extracted postcodes, simply:
$> wc -l CAP.csv
8638 cap.csv

For an overview of firsts and lasts codes:
$> head -3 CAP.csv && echo “…” && tail -3 CAP.csv
Abano Terme,35031
Abbadia Cerreto,26834
Abbadia Lariana,23821

Zumpano,87040
Zungoli,83030
Zungri,89867

Download

Please, find in CSVs repo processed files.

电子邮件图标 Bluesky图标 Facebook图标 LinkedIn图标 Mastodon图标 Telegram图标 X图标

讨论

登录以留下评论