Giter Club home page Giter Club logo

geojson-italy's Introduction

Introduction

This repository contains geo-referenced limits for all municipalities in Italy, and their breakdown by regions and provinces.

The geographic projection used is WGS84.

The limits are released both in topojson with a high simplification rate (20%), and the non-simplified geojson format.

As administrative limits change continuously, the files are upgraded periodically, and refer to the latest administrative subdivisions, as published by ISTAT in this permalink (hoping it's actually a permalink).

Historical versions, year by year, are published as tags, currently only 2019 and 2021 are present.

The master branch currently contains limits as of June 2023.

Attribution

The original administrative limits data are copyrighted by ISTAT, that releases them under the CC-BY license. The data generated and published here are released under the same CC-BY license.

Geojson files

These files are not simplified, contain a large number of vectors, and can only contain one layer. They are compatible with almost all visualisers and applications, and can be used to integrate geographic information, almost as ubiquitously as shp files.

As of June 2023 (tag 2023.1), the geojson files are produced using the gj2008 flag of mapshaper, in order to make them compatile with the pre-RFC 7946 GeoJSON spec, and with the D3 javascript library, and other libraries using D3 underneath, as Plotly, for example. You can find the original discussion in this mapshaper's issue.

The following files are available:

Please consider that maps preview for geojson data are only available for files of limited size in github.com; use mapshaper to see and explore larger files.

Topojson files

These files are simplified, smaller, but less precise, and contains a lot less vectors than the corresponding geojson files, can contain many layers, and can be used in compatible map visualisers (leaflet, d3, mapshaper).

The following topojson files are available:

Please consider that maps preview for topojson data are not available on github.com; use mapshaper to see the files.

Metadata

Each geographic area has the following metadata:

  • name (M) - the name of the municipality
  • com_catasto_code (M) - the cadaster code (H501)
  • com_istat_code (M) - the ISTAT code, as text (zero-padded)
  • com_istat_code_num (M) - the ISTAT code, as integer
  • op_id (M) - the openpolis ID (for integration with legacy OP data)
  • opdm_id (M) - the opdm ID (for integration with OPDM data)
  • minint_elettorale (M) - interior minister ID
  • prov_name (M,P) - parent province name
  • prov_istat_code (M,P) - parent province ISTAT code, as text (zero-padded)
  • prov_istat_code_num (M,P) - parent province ISTAT code, as integer
  • prov_acr (M,P,R) - parent province acronym (ex: RM)
  • reg_name (M,P,R) - parent region full name
  • reg_istat_code (M,P,R) - parent region ISTAT code, as text (zero padded)
  • reg_istat_code_num (M,P,R) - parent region ISTAT code, as number

In parenthesis, the contexts where these properties can be found:

  • M: Municipalities,
  • P: Provinces,
  • R: Regions

Developers

To generate all files, starting from the comuni.geojson file:

  ./generate_geojson.sh
  ./generate_topojson.sh

The mapshaper client, based on node js, is required by the scripts to work.

How the comuni.geojson file is generated, and other scripts' internals are described in this wiki page.

geojson-italy's People

Contributors

deuteu avatar guglielmo avatar mlocati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

geojson-italy's Issues

missing data for 2 municipalities

I noticed that compared to the istat dataset (https://www.istat.it/it/archivio/222527) the data is missing for 2 municipalities.
From wikipedia: one municipality changed code on 15/05/2023 (https://it.wikipedia.org/wiki/Moransengo-Tonengo) while the other was established on 01/01/2023 mergering 3 municipalities (https://it.wikipedia.org/wiki/Bardello_con_Malgesso_e_Bregano).

Here is a quick R code for verification. (The thing is easily noticed also graphically because using municipalities maps have holes)

#### installation of the required packages if they are not already present and loading

libraries <- c("dplyr", "sf")
for(library in libraries){
  if(!library %in% installed.packages()){
    install.packages(library)
  }
  library(library, character.only = TRUE)
}


### download of the 2 data sets

## download from github

# https://github.com/openpolis/geojson-italy
# GitHub repository url
url_regions <- "https://github.com/openpolis/geojson-italy/raw/master/geojson/limits_IT_regions.geojson"
url_provinces <- "https://github.com/openpolis/geojson-italy/raw/master/geojson/limits_IT_provinces.geojson"
url_municipalities <- "https://github.com/openpolis/geojson-italy/raw/master/geojson/limits_IT_municipalities.geojson"
# reading GeoJSON files
regions_github <- st_read(url_regions)
provinces_github <- st_read(url_provinces)
municipalities_github <- st_read(url_municipalities)

## download from istat website

# https://www.istat.it/it/archivio/222527 -> description: https://www.istat.it/it/files//2018/10/Descrizione-dei-dati-geografici-2020-03-19.pdf
# download file "Administrative boundaries 2023 (zip)" from the link
# setting the correct working directory
setwd("...")
# import of the extracted files based on the administrative category
# with transformation of data from CRS WGS 84 / UTM zone 32N to CRS WGS84 (EPSG:4326)
municipalities <- st_transform(st_read("Limiti01012023/Com01012023/Com01012023_WGS84.shp"), crs_wgs84)
provinces <- st_transform(st_read("Limiti01012023/ProvCM01012023/ProvCM01012023_WGS84.shp"), crs_wgs84)
regions <- st_transform(st_read("Limiti01012023/Reg01012023/Reg01012023_WGS84.shp"), crs_wgs84)


### verification that 2 municipalities are missing

## conversion of spatial data into a normal dataframe
municipalities_df <- as.data.frame(municipalities)
municipalities_github_df <- as.data.frame(municipalities_github)
provinces_df <- as.data.frame(provinces)
provinces_github_df <- as.data.frame(provinces_github)
regions_df <- as.data.frame(regions)
regions_github_df <- as.data.frame(regions_github)

## verification using istat codes

# change of column names to make the comparison easier
municipalities_github_df <- rename(municipalities_github_df, PRO_COM_T = com_istat_code)
provinces_github_df <- rename(provinces_github_df, COD_PROV = prov_istat_code_num)
regions_github_df <- rename(regions_github_df, COD_REG  = reg_istat_code_num)

# anti_join to select the elements of the left df that are not present in the right df
differences_municipalities <- anti_join(municipalities_df, municipalities_github_df, by = "PRO_COM_T")
differences_provinces <- anti_join(provinces_df, provinces_github_df, by = "COD_PROV")
differences_regions <- anti_join(regions_df, regions_github_df, by = "COD_REG")

# print the number of differences found
print(paste("Number of missing municipalities:", nrow(differences_municipalities))) # -> : 2
print(paste("Number of missing provinces:", nrow(differences_provinces))) # -> : 0
print(paste("Number of missing regions:", nrow(differences_regions))) # -> : 0

# print the names of the missing municipalities
print(differences_municipalities$COMUNE)
# -> 
# [1] "Bardello with Malgesso and Bregano"
# [2] "Moransengo-Tonengo"

CAP / ZIP code limits

Hi there,
thanks for this awesome project.
Is there any chance that CAP (postal ZIP codes) geo-limits can be added to the project?

Thank you

Municipalities fractions

Hi all,
thank you for the great project.

I have seen that municipalities geojson doesn't contains municipalities fractions ("frazioni"), and also I can't find these areas limits in the source files on the ISTAT site, I have just found shapefiles that contains fractions as points.
I was wondering if anyone else has ever faced this issue, and knows if there is a way to retrieve municipalities fractions limits.

Thank you!

Holes in provinces and regions

There are some holes in provinces and regions.

Regions:

  • Piemonte, Lombardia, Veneto, Campania, Puglia

Provinces:

  • Treviso, Belluno, Vicenza,
  • Milano, Varese, Bergamo/Lecco
  • Alessandria
  • Napoli (Capri/Anacapri)

Wrong values of com_istat_code in topojson/limits_IT_all.topo.json

I've compared the values of the com_istat_code attributes of the municipalities found in the topojson/limits_IT_all.topo.json file with then Elenco-comuni-italiani.xls file provided by ISTAT, and I found a few errors.
You can also see that those municipality codes are wrong because they don't start with the province codes (prov_istat_code attribute).

Here's the list (you can also download this list in CSV format for your convenience):

name prov_istat_code wrong com_istat_code correct com_istat_code
Abbadia Lariana 097 013001 097001
Aggius 090 104001 090001
Aglientu 090 104002 090062
Agrate Brianza 108 015003 108001
Aicurzio 108 015004 108002
Albiate 108 015006 108003
Amandola 109 044004 109002
Andorno Micca 096 002005 096002
Annone di Brianza 097 013008 097003
Antrona Schieranco 103 003003 103001
Anzola d'Ossola 103 003004 103002
Arcore 108 015008 108004
Arena 102 079006 102002
Arola 103 003007 103004
Arzachena 090 104004 090006
Arzana 091 105001 091002
Ballabio 097 013014 097004
Bari Sardo 091 105002 091005
Barlassina 108 015013 108005
Barzago 097 013016 097005
Baunei 091 105003 091006
Bellaria-Igea Marina 099 040002 099001
Belmonte Piceno 109 044008 109003
Belvedere di Spinello 101 079010 101001
Benna 096 002010 096003
Biella 096 002012 096004
Bognanco 103 003020 103012
Borghetto Lodigiano 098 015028 098004
Borgo San Giovanni 098 015029 098005
Bortigiadas 090 104007 090014
Brembio 098 015031 098006
Briosco 108 015033 108011
Brivio 097 013031 097010
Brugherio 108 015034 108012
Buddusò 090 104008 090017
Buggerru 111 107001 111006
Bulciago 097 013033 097011
Burcei 111 092008 111007
Caccuri 101 079015 101002
Calangianus 090 104010 090021
Calasca-Castiglione 103 003029 103014
Callabiana 096 002022 096008
Camandona 096 002023 096009
Cambiasca 103 003031 103015
Camburzano 096 002024 096010
Camparada 108 015045 108014
Campofilone 109 044009 109004
Candelo 096 002027 096012
Cannobio 103 003034 103017
Capistrano 102 079016 102005
Caprezzo 103 003035 103018
Caprile 096 002028 096013
Cardedu 091 105004 091103
Carenno 097 016054 097014
Carfizzi 101 079019 101003
Carloforte 111 092013 111010
Carnate 108 015049 108016
Casabona 101 079021 101004
Casale Corte Cerro 103 003038 103019
Casalmaiocco 098 015053 098009
Casargo 097 013049 097015
Casatenovo 097 013051 097016
Caselle Landi 098 015056 098011
Caselle Lurani 098 015057 098012
Cassina Valsassina 097 013056 097018
Castello di Brianza 097 013057 097019
Castiraga Vidardo 098 015065 098015
Cattolica 099 040006 099002
Cavenago di Brianza 108 015068 108017
Ceriano Laghetto 108 015069 108018
Cernusco Lombardone 097 013066 097020
Cervignano d'Adda 098 015073 098018
Cesana Brianza 097 013067 097021
Cesano Maderno 108 015075 108019
Cesara 103 003050 103022
Cirò Marina 101 079032 101008
Civate 097 013069 097022
Cogliate 108 015080 108020
Colico 097 013072 097023
Collinas 111 092014 111012
Concorezzo 108 015084 108021
Cornegliano Laudense 098 015089 098021
Corno Giovine 098 015090 098022
Correzzana 108 015092 108022
Cossogno 103 003053 103023
Costa Masnaga 097 013079 097026
Cotronei 101 079035 101009
Craveggia 103 003054 103024
Cremeno 097 013082 097029
Crodo 103 003057 103026
Crucoli 101 079038 101011
Cutro 101 079040 101012
Dervio 097 013086 097030
Dolianova 111 092017 111014
Domusnovas 111 092019 111016
Donori 111 092020 111017
Dorzano 096 002056 096025
Drapia 102 079045 102009
Erve 097 016095 097034
Escalaplano 111 092110 111018
Esino Lario 097 013096 097035
Esterzili 111 091022 111020
Fabrizia 102 079046 102010
Filadelfia 102 079049 102011
Flussio 095 091023 095080
Fombio 098 015102 098026
Formazza 103 003067 103031
Francavilla Angitola 102 079053 102014
Gaglianico 096 002060 096026
Gairo 091 105006 091026
Galgagnano 098 015104 098027
Garbagnate Monastero 097 013104 097037
Garlate 097 013105 097038
Genoni 111 095081 111023
Genuri 111 106005 111024
Germagno 103 003072 103032
Gesturi 111 092025 111027
Giba 111 092026 111028
Gifflenga 096 002063 096027
Giussano 108 015107 108024
Golfo Aranci 090 104011 090083
Goni 111 092027 111029
Guamaggiore 111 092030 111032
Gurro 103 003080 103036
Guspini 111 106008 111034
Ilbono 091 105008 091032
Imbersago 097 013115 097039
Isili 111 091034 111036
Isola di Capo Rizzuto 101 079064 101013
La Maddalena 090 104012 090035
Las Plassas 111 106009 111037
Lazzate 108 015117 108025
Lesmo 108 015120 108026
Limbadi 102 079067 102019
Loiri Porto San Paolo 090 104013 090084
Lomagna 097 013132 097044
Lunamatrona 111 092035 111038
Macherio 108 015129 108029
Macugnaga 103 003086 103039
Madonna del Sasso 103 003087 103040
Magliano di Tenna 109 044026 109010
Magnano 096 002073 096030
Magomadas 095 091045 095083
Maierato 102 079070 102020
Mairago 098 015132 098034
Malesco 103 003089 103041
Malgrate 097 013140 097045
Mandas 111 092036 111039
Margno 097 013142 097047
Marudo 098 015135 098036
Massalengo 098 015137 098037
Massazza 096 002074 096031
Meleti 098 015141 098038
Melissa 101 079075 101014
Mesoraca 101 079076 101015
Mezzago 108 015145 108031
Mezzana Mortigliengo 096 002076 096033
Miazzina 103 003099 103045
Misinto 108 015147 108032
Modolo 095 091048 095084
Moggio 097 013150 097050
Mondaino 099 040023 099006
Mongiana 102 079079 102022
Mongrando 096 002080 096035
Montanaso Lombardo 098 015148 098040
Monte Marenzo 097 016138 097052
Monte Vidon Corrado 109 044051 109026
Montecrestese 103 003101 103046
Montefortino 109 044037 109015
Montegridolfo 099 040026 099009
Monterubbiano 109 044047 109022
Montevecchia 097 013247 097053
Monticello Brianza 097 013156 097054
Montottone 109 044052 109027
Morciano di Romagna 099 040029 099011
Moresco 109 044053 109028
Morterone 097 013158 097055
Mottalciata 096 002083 096037
Musei 111 107011 111043
Muzzano 096 002084 096038
Narcao 111 092041 111044
Netro 096 002085 096039
Nonio 103 003105 103048
Nova Milanese 108 015156 108035
Nuragus 111 091052 111045
Nuraminis 111 092042 111047
Nurri 111 091054 111048
Nuxis 111 092043 111049
Occhieppo Superiore 096 002087 096041
Oggebbio 103 003107 103049
Olgiate Molgora 097 013166 097058
Ornavasso 103 003111 103051
Ortacesus 111 092044 111051
Ortezzano 109 044055 109029
Osnago 097 013171 097061
Ospedaletto Lodigiano 098 015162 098043
Ossago Lodigiano 098 015163 098044
Pabillonis 111 106011 111052
Palau 090 104020 090054
Parghelia 102 079091 102026
Pauli Arbarei 111 092046 111053
Pedaso 109 044057 109030
Perdasdefogu 091 105014 091072
Perdaxius 111 107014 111054
Perledo 097 013181 097067
Pescate 097 013182 097068
Pettinengo 096 002092 096042
Piatto 096 002094 096043
Piedimulera 103 003117 103053
Pieve Fissiraga 098 015174 098045
Pieve Vergonte 103 003118 103054
Piscinas 111 107015 111056
Pizzoni 102 079098 102028
Poggio a Caiano 100 048051 100004
Ponderano 096 002100 096047
Ponzano di Fermo 109 044059 109032
Porto Sant'Elpidio 109 044061 109034
Premana 097 013190 097069
Premeno 103 003123 103055
Premia 103 003124 103056
Quarna Sopra 103 003126 103058
Quarna Sotto 103 003127 103059
Rapagnano 109 044062 109035
Re 103 003128 103060
Renate 108 015180 108037
Riccione 099 040034 099013
Robbiate 097 013196 097071
Rocca di Neto 101 079103 101019
Roccabernarda 101 079102 101018
Rogeno 097 013198 097072
Roncello 108 015186 108055
Ronco Biellese 096 002117 096053
Ronco Briantino 108 015187 108038
Roppolo 096 002119 096054
Sadali 111 092119 111058
Sagliano Micca 096 002124 096056
Salerano sul Lambro 098 015190 098046
Saludecio 099 040038 099015
Samatzai 111 092053 111060
San Bernardino Verbano 103 003132 103061
San Calogero 102 079106 102032
San Costantino Calabro 102 079107 102033
San Ferdinando di Puglia 110 071045 110007
San Fiorano 098 015193 098047
San Gavino Monreale 111 106014 111062
San Gregorio d'Ippona 102 079109 102034
San Leo 099 041053 099025
San Mauro Marchesato 101 079111 101020
San Nicolò Gerrei 111 092058 111064
San Nicola da Crissa 102 079112 102035
San Nicola dell'Alto 101 079113 101021
San Sperate 111 092059 111065
San Teodoro 090 091076 090092
San Vito 111 092064 111066
Sandigliano 096 002130 096059
Sanluri 111 092057 111067
Sant'Agata Feltria 099 041055 099026
Sant'Andrea Frius 111 092061 111069
Sant'Anna Arresi 111 092062 111070
Sant'Antioco 111 092063 111071
Sant'Antonio di Gallura 090 104021 090085
Sant'Elpidio a Mare 109 044068 109037
Sant'Onofrio 102 079121 102036
Santa Maria Hoè 097 013209 097074
Santa Teresa Gallura 090 104022 090063
Santa Vittoria in Matenano 109 044067 109036
Santarcangelo di Romagna 099 040042 099018
Santo Stefano Lodigiano 098 015199 098051
Sardara 111 092065 111072
Secugnago 098 015203 098052
Seregno 108 015208 108039
Serra San Bruno 102 079128 102037
Serramanna 111 092072 111077
Serri 111 091080 111079
Servigliano 109 044069 109038
Setzu 111 092076 111080
Seulo 111 091082 111082
Seveso 108 015212 108040
Siddi 111 106021 111083
Siliqua 111 092078 111084
Sirone 097 013213 097075
Siurgus Donigala 111 092081 111086
Smerillo 109 044070 109039
Soleminis 111 092082 111087
Somaglia 098 015214 098054
Sordevolo 096 002139 096063
Sordio 098 015215 098055
Sorianello 102 079135 102039
Sostegno 096 002140 096064
Spilinga 102 079141 102042
Stresa 103 003142 103064
Suello 097 013220 097078
Taceno 097 013221 097079
Talamello 099 041063 099027
Tavigliano 096 002143 096066
Telti 090 104024 090080
Tertenia 091 105017 091089
Teulada 111 092084 111089
Tinnura 095 091092 095088
Torre de' Busi 016 097080 016215
Torre San Patrizio 109 044072 109040
Tortolì 091 105018 091095
Trani 110 072045 110009
Trarego Viggiona 103 003147 103066
Tratalias 111 107021 111090
Trinitapoli 110 071057 110010
Turano Lodigiano 098 015225 098058
Valdengo 096 002151 096071
Valera Fratta 098 015228 098059
Vallanzengo 096 002153 096072
Valle San Nicolao 096 002155 096074
Vanzone con San Carlo 103 003152 103070
Varedo 108 015231 108045
Varzo 103 003155 103071
Veduggio con Colzano 108 015233 108047
Veglio 096 002157 096075
Verano Brianza 108 015234 108048
Vercurago 097 016231 097086
Verucchio 099 040051 099020
Vigliano Biellese 096 002160 096077
Villa del Bosco 096 002161 096078
Villacidro 111 106025 111096
Villadossola 103 003162 103075
Villagrande Strisaili 091 105023 091101
Villamar 111 092093 111097
Villamassargia 111 107022 111098
Villanova Tulo 111 092122 111099
Villanovaforru 111 092095 111100
Villanovafranca 111 092096 111101
Villaputzu 111 092097 111103
Villasalto 111 092098 111104
Villasanta 108 015239 108049
Villasor 111 092101 111106
Villaspeciosa 111 092102 111107
Villette 103 003163 103076
Vimercate 108 015241 108050
Zelo Buon Persico 098 015245 098061
Zimone 096 002167 096081
Zumaglia 096 002169 096083

city subdivision

I'm looking for city subdivisions but I can't find them.
So, if there are those subdivisions, can you tell me please where to find them? And maybe how to read the json to get this information.
Thanks

Missing municipalities in topojson/limits_IT_all.topo.json

I've compared the municipalities in the topojson/limits_IT_all.topo.json file with other municipality lists, and I've found that the following municipalities are not present in the topojson/limits_IT_all.topo.json file:

ISTAT Code Municipality
001087 Claviere
013032 Brunate
015170 Pero
016027 Blello
016251 Solza
059033 Ventotene
063061 Procida
063069 San Paolo Bel Sito
071026 Isole Tremiti
093052 Vajont
096034 Miagliano

Adding Regions Abbreviation

Hello,

could be useful to add the Region abbreviation on the geojson/limits_IT_regions.geojson like "LOM" for Lombardia or "LAZ" for Lazio?

Error: [clean] Received one or more unexpected parameters: encoding=utf8

Hello,

When launching any of the bash scripts commands ./generate_geojson.sh or ./generate_topojson.sh it returns me the following error:

Error: [clean] Received one or more unexpected parameters: encoding=utf8 Run mapshaper -h to view help

These are my settings:

OS: Ubuntu 22.04.4 LTS
Mapshaper version: 0.6.65
Node version: v18.13.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.