Buildings
GET /contesto/edifici
Building stock of the census area around the point: how many buildings there are, when they were built, how big they are, in what condition, and how densely they sit.
Example Request
curl --location 'https://sandbox-context.realitycs.it/contesto/edifici?latitudine=43.32215&longitudine=11.3259&raggio=250' \
--header 'Authorization: Bearer <token>'
Request Fields
| Field | Required | Default | Description | Type | Example | Notes |
|---|---|---|---|---|---|---|
latitudine | yes | Latitude of the point | number | 43.32215 | ||
longitudine | yes | Longitude of the point | number | 11.3259 | ||
raggio | optional | 500 | Search radius around the point, in metres | number | 250 | From 1 to 1000 |
JSON keys in the response:
Every entry is an object with a qt value and a desc human readable label in Italian, keyed by its ISTAT census code. Keys ending in _perc are percentages, the others are absolute counts.
Totals
| Key | Description |
|---|---|
e1 | Buildings and building complexes, total |
e2_perc | Buildings in use, in percentage |
e3_perc | Buildings in residential use, in percentage |
diff_perc | Buildings not in use, in percentage |
diff_res_perc | Residential buildings not in use, in percentage |
Construction period
Percentages of the residential buildings, by period: e8_perc before 1919, e9_perc 1919 - 1945, e10_perc 1946 - 1960, e11_perc 1961 - 1970, e12_perc 1971 - 1980, e13_perc 1981 - 1990, e14_perc 1991 - 2000, e15_perc 2001 - 2005, e16_perc after 2005.
Number of floors
Percentages of the residential buildings: e17_perc 1 floor, e18_perc 2 floors, e19_perc 3 floors, e20_perc 4 floors or more.
Number of units
Percentages of the residential buildings: e21_perc 1 unit, e22_perc 2 units, e23_perc 3 to 4, e24_perc 5 to 8, e25_perc 9 to 15, e26_perc 16 or more.
Condition
Percentages of the residential buildings: e28_perc excellent, e29_perc good, e30_perc mediocre, e31_perc poor.
densita
Unlike everything else in this block, densita is a plain string rather than a qt and desc pair. It carries a qualitative rating of the building density, such as MEDIA.
densita breaks the shape of the block
Code that iterates over edifici reading entry.qt and entry.desc will fail on densita, which is a string. Handle it separately, or guard the iteration on the value being an object.
diff_perc and diff_res_perc share the same desc
Both are labelled "edifici e complessi di edifici non utilizzati percentuale", although they carry different figures: in the example below diff_perc is 0 while diff_res_perc is 39.16. The label of diff_res_perc is wrong, it describes the residential buildings not in use. Do not rely on desc to tell these two apart.
Census codes are not contiguous
The sequence skips e4 to e7 and e27, and sorting the keys as strings puts e2_perc after e26_perc. Do not assume the codes are dense or that lexicographic order is meaningful.
Example Response
Note
The example below is truncated to one entry per group, the actual response returns all the indicators listed above.
{
"contesto": {
"edifici": {
"e1": {
"desc": "edifici e complessi di edifici - totale",
"qt": 95
},
"e2_perc": {
"desc": "edifici e complessi di edifici utilizzati percentuale",
"qt": 100
},
"e3_perc": {
"desc": "edifici ad uso residenziale percentuale",
"qt": 60.84
},
"diff_perc": {
"desc": "edifici e complessi di edifici non utilizzati percentuale",
"qt": 0
},
"diff_res_perc": {
"desc": "edifici e complessi di edifici non utilizzati percentuale",
"qt": 39.16
},
"e8_perc": {
"desc": "edifici ad uso residenziale costruiti prima del 1919 percentuale",
"qt": 85.82
},
"e20_perc": {
"desc": "edifici ad uso residenziale con 4 piani o più percentuale",
"qt": 87.27
},
"e23_perc": {
"desc": "edifici ad uso residenziale da 3 a 4 interni percentuale",
"qt": 32.85
},
"e29_perc": {
"desc": "edifici ad uso residenziale con stato di conservazione buono percentuale",
"qt": 95.81
},
"densita": "MEDIA"
}
}
}