Restriction Zone

Consulting the restricted zone

To query a restriction zone you must make a GET request to the following endpoint:

To consult the restriction zone created in the previous example, we will make a GET request to the endpoint: https://api.maplink.global/restriction/v1/restrictionZones/RestrictionZone1

The response will return all the information regarding the desired restriction zone. The field status indicates whether the restriction zone is ready for use or whether there was an error in its creation, such as an incomplete polygon, for example.

The possible values can be returned at status:

  • IN_CALCULATION("Calculating roads inside geometries") – This means that the restriction zone is still being processed and is not available for use.
  • CALCULATED("Roads inside restriction zone calculated") – The restriction zone has been successfully created and is now available for use.
  • CALCULATED_WITHOUT_ROADS("No road found after calculation inside restriction zone") – The restriction zone has been successfully created, but there is no road running through it.
  • CALCULATION_ERROR("Error trying to calculate restriction zone: [%s]") – There has been an error in the creation of the restriction zone and it is not available for use. The error message will give more details of what may have happened.

The full response can be found below:

{
    "name": "RestrictionZone1",
    "geometries": [
        {
            "name": "Polygon1",
            "vertices": [
                {
                    "latitude": -23.694834,
                    "longitude": -46.777038
                },
                {
                    "latitude": -23.694834,
                    "longitude": -46.448822
                },
                {
                    "latitude": -23.472064,
                    "longitude": -46.448822
                },
                {
                    "latitude": -23.472064,
                    "longitude": -46.777038
                }
            ]
        }
    ],
    "status": {
        "name": "CALCULATED",
        "description": "Roads inside restriction zone calculated"
    }
}