OpenStreetMap 로고 OpenStreetMap

CAP (postcodes) of Italy

Cascafico님이 English로 2018년 8월 29일에 게시함. 최근 2020년 9월 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 아이콘 마스토돈 아이콘 텔레그램 아이콘 X 아이콘

토론

댓글을 남기려면 로그인하세요