Download the PHP package mlocati/comuni-italiani without Composer
On this page you can find all versions of the php package mlocati/comuni-italiani. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mlocati/comuni-italiani
More information about mlocati/comuni-italiani
Files in mlocati/comuni-italiani
Package comuni-italiani
Short Description List of Italian Regioni (Regions), Province (Provinces), and Comuni (Municipalities) with data from Istat
License MIT
Homepage https://github.com/mlocati/comuni-italiani
Informations about the package comuni-italiani
Comuni Italiani
This PHP library contains the whole list of Italian Regions (regioni), Provinces (province/UTS), and Municipalities (comuni).
The data comes from the official Situas service of the Istituto nazionale di statistica (Istat), that publishes its data with the CC-BY-4.0 license .
Installation
You can install this package with Composer:
Data Structure
This library provides the following Italian Administrative divisions:
- Geographical Subdivisions (ripartizioni geografiche) For example "Nord-ovest", "Centro", "Sud"
- Regions (regioni) For example "Piemonte", "Lazio", "Campania"
- Provinces (province) and Supra-Municipal Territorial Units (UTS - unità territoriale sovracomunale)
- Municipalities (comuni)
Where:
- every Geographical Subdivision contains one or more Regions
- every Region contains one or more Provinces/UTS
- every Province/UTS contains one or more Municipalities
Data Available
This library provides the following data:
- for the Geographical Subdivisions
- the Istat ID (example:
1
) - the name (example:
'Nord-ovest'
) - the first level of the current Nomenclature of Territorial Units for Statistics (NUTS1) (example:
'ITC'
) - the list of Regions
- the Istat ID (example:
- for the Regions
- the parent Geographical Subdivision
- the Istat ID (example:
'01'
) - the name (example:
'Piemonte'
) - the type:
- Ordinary Status (regione a statuto ordinario)
- Special Status (regione a statuto speciale)
- the Fiscal Code (codice fiscale) assigned by the Agenzia delle Entrate (example:
'80087670016'
) - the second level of the current Nomenclature of Territorial Units for Statistics (NUTS2) (example:
'ITC1'
) - the Capital Municipality of this Region (capoluogo di regione) (example:
'Torino'
) - the list of Provinces/UTS
- for the Provinces / UTS
- the parent Region
- the Istat ID (example:
'201'
) - the name (example:
'Torino'
) - the historical Province code (example:
'001'
) - the type:
- Province (provincia)
- Autonomous Province (provincia autonoma)
- Metropolitan City (città metropolitana)
- Free Consortium of Municipalities (libero consorzio di comuni)
- Non-Administrative Unit (unità non amministrativa) - former Provinces of Friuli-Venezia Giulia
- the vehicle code (sigla automobilistica) (example:
'TO'
) - the Fiscal Code (codice fiscale) assigned by the Agenzia delle Entrate (example:
'01907990012'
) - the third level of the current Nomenclature of Territorial Units for Statistics (NUTS3) (example:
'ITC11'
) - the Capital Municipalities of this Province/UTS (capoluogo di provincia) (example:
'Torino'
) - the list of Municipalities
- for the Municipalities
- the parent Province/UTS
- the Istat ID (example:
'001272'
) - the name (example:
'Torino'
) - the Italian and Foreign names for bilingual municipalities (for example:
'Bolzano'
and'Bozen'
) - if the Municipality is the Capital Municipality of its Region (capoluogo di regione)
- if the Municipalities is a Capital Municipalities of its Province/UTS (capoluogo di provincia)
- the Cadastral Code (codice catastale) (example:
'L219'
) - the Fiscal Code (codice fiscale) assigned by the Agenzia delle Entrate (example:
'00514490010'
) - the first level of the current Nomenclature of Territorial Units for Statistics (NUTS1) (example:
'ITC'
) - the second level of the current Nomenclature of Territorial Units for Statistics (NUTS2) (example:
'ITC1'
) - the third level of the current Nomenclature of Territorial Units for Statistics (NUTS3) (example:
'ITC11'
)
Retrieving All Territories
You can have a list of all the Geographical Subdivisions, Regions, Provinces/UTS, and Municipalities using the Factory
class.
For example:
Finding Territories by ID
If you want to retrieve a territory given its ID, you can use the Finder
class:
Finding Provinces by Vehicle Code
You can use the getProvinceByVehicleCode
method of the Finder
class:
Finding Territories by Name
You can use the Finder
class to find Geographical Subdivisions, Regions, Provinces/UTS, and Municipalities by name.
The text to be searched will be split into words, and you'll get the territories whose names contain all the words.
For example, searching for roma lombard
will return the Romano di Lombardia (BG)
municipality.
Examples:
By default, Finder will look for the beginning of words.
So, ampania
won't match Campania
.
If you want to allow searching in the middle of the words, specify true
as the second parameter:
You can also restrict the search to specific territories:
Testing Hierarchy
Given two territories, you can check if they are the same by using the isSame()
method:
You can also check if a territory is contained in another territory:
For Geographical Subdivisions, Regions, and Provinces/UTS (which are containers of other territories) you can also use the contains()
and isSameOrContains()
methods.