Skip to content

Full context

GET /contesto

The whole context of a point in a single call: services, transport, population, buildings, roads, land use and traffic, plus two fields that no other endpoint returns.

Example Request

curl --location 'https://sandbox-context.realitycs.it/contesto?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:

Summary fields

Four scalar fields summarise the area as uppercase Italian strings:

  • localizzazione: Position of the point within its settlement, such as CENTRALE.
  • contesto: Type of settlement, such as URBANO.
  • destinazione_uso: Prevailing land use, such as RESIDENZIALE.
  • traffico_intensita: Traffic intensity, such as MEDIO. Same value as Traffic.

localizzazione and contesto exist only here

These two fields are not returned by any thematic endpoint. If you need them, this is the only call that provides them, and it is the main reason to prefer it over the individual blocks.

Note that contesto is nested inside the contesto envelope, so the full path is contesto.contesto.

Blocks

Block Same as
servizi Services
trasporti Transport
popolazione Population
edifici Buildings
strade Roads

Each block has the shape documented on its own page.

destinazione_uso is a string here, an object there

The name is shared with Land use, but the content is not. Here it is a plain string naming the prevailing use. On the dedicated endpoint it is an object carrying the full percentage breakdown under uso_suolo_per.dettaglio, with the same information as prevalente.

If you need the breakdown and not just the winner, call Land use: this endpoint does not expose it.

servizi has one category more than the dedicated endpoint

This call returns fourteen service categories, ufficio_postale included, while Services returns thirteen and never reports post offices. At the same point and radius ufficio_postale comes back here as null where there is none, but the key is present.

trasporti instead matches Transport exactly, with the same four categories and without aeroporto, porto or casello_autostradale.

When to use it

Prefer this endpoint when you need several blocks at once: it costs one round trip instead of up to seven, and it is the only way to get localizzazione and contesto.

Prefer the thematic endpoints when you need one block only, or when you need the land use breakdown. The payload here is substantially larger, around 23 KB against the 43 bytes of Traffic for the same point.

Example Response

Note

The example below is heavily truncated: one entry per service and transport category, two population indicators out of 21, two building indicators out of 29, and the car park polygon cut to three positions. The actual response returns every block in full.

{
  "contesto": {
    "localizzazione": "CENTRALE",
    "contesto": "URBANO",
    "destinazione_uso": "RESIDENZIALE",
    "traffico_intensita": "MEDIO",
    "trasporti": {
      "bus_fermata": [
        {
          "nome": "VIA TOZZI",
          "distanza": 156,
          "geojson": {
            "coordinates": [
              11.327807,
              43.322005
            ],
            "type": "Point"
          }
        }
      ],
      "metro_fermata": null,
      "tram_fermata": null,
      "stazione": null
    },
    "servizi": {
      "negozio": [
        {
          "nome": "SIENA MERCATO",
          "distanza": 88,
          "geojson": {
            "coordinates": [
              11.32553,
              43.32289
            ],
            "type": "Point"
          },
          "tag": "servizi"
        }
      ],
      "supermercato": [
        {
          "nome": "CONAD",
          "distanza": 233,
          "geojson": {
            "coordinates": [
              11.32863,
              43.32151
            ],
            "type": "Point"
          }
        }
      ],
      "asilo": [
        {
          "nome": "MONUMENTO",
          "distanza": 238,
          "geojson": {
            "coordinates": [
              11.32699,
              43.324138
            ],
            "type": "Point"
          }
        }
      ],
      "scuola": [
        {
          "nome": "ACHILLE SCLAVO",
          "distanza": 196,
          "geojson": {
            "coordinates": [
              11.32351,
              43.32238
            ],
            "type": "Point"
          }
        }
      ],
      "universita": null,
      "ospedale": null,
      "ristorante": [
        {
          "nome": "GOLD FINGER BAR",
          "distanza": 29,
          "geojson": {
            "coordinates": [
              11.32579,
              43.3224
            ],
            "type": "Point"
          }
        }
      ],
      "banca": [
        {
          "nome": "BANCA MONTE DEI PASCHI DI SIENA SPA",
          "distanza": 182,
          "geojson": {
            "coordinates": [
              11.32586,
              43.32379
            ],
            "type": "Point"
          }
        }
      ],
      "farmacia": [
        {
          "nome": "PARAFARMACIA DRUGSTORE SAN DOMENICO DOTTORE SECCIANI FRANCESCO",
          "distanza": 231,
          "geojson": {
            "coordinates": [
              11.3277,
              43.32054
            ],
            "type": "Point"
          }
        }
      ],
      "ufficio_postale": null,
      "hotel": [
        {
          "nome": "NH EXCELSIOR",
          "distanza": 132,
          "geojson": {
            "coordinates": [
              11.327228,
              43.322844
            ],
            "type": "Point"
          }
        }
      ],
      "palestra": [
        {
          "nome": "DENTRO LE MURA",
          "distanza": 189,
          "geojson": {
            "coordinates": [
              11.32644,
              43.320493
            ],
            "type": "Point"
          }
        }
      ],
      "parcheggio": [
        {
          "nome": "PARCHEGGIO STADIO",
          "distanza": 37,
          "geojson": {
            "coordinates": [
              [
                [
                  [
                    11.32438,
                    43.321409
                  ],
                  [
                    11.324399,
                    43.321414
                  ],
                  [
                    11.324423,
                    43.321421
                  ]
                ]
              ]
            ],
            "type": "MultiPolygon"
          }
        }
      ],
      "parco": [
        {
          "nome": "LA LIZZA",
          "distanza": 124,
          "geojson": {
            "coordinates": [
              11.32626,
              43.323535
            ],
            "type": "Point"
          }
        }
      ]
    },
    "popolazione": {
      "it_perc": {
        "desc": "italiani residenti percentuale",
        "qt": 94.44
      },
      "p1": {
        "desc": "popolazione residente",
        "qt": 389
      }
    },
    "edifici": {
      "e1": {
        "desc": "edifici e complessi di edifici - totale",
        "qt": 95
      },
      "densita": "MEDIA"
    },
    "strade": [
      {
        "tipo": "Locali",
        "per": 9.31
      },
      {
        "tipo": "Pedonali / ciclabili",
        "per": 58.89
      },
      {
        "tipo": "Residenziali / servizio",
        "per": 31.8
      }
    ]
  }
}