Restriction Zone

Inserting a new restriction zone

To insert a new restriction zone you will make a POST request to the following endpoint:

https://api.maplink.global/restriction/v1/restrictionZonesPOST

You will need an array with the latitudes and longitudes of each vertex in the polygon.

The following parameters must be entered:

  • name – Unique name with the name of the restricted area;
  • geometries – Array containing the polygons with their respective vertices in the restriction zone. You can register one or more geometries in the same restriction zone, as long as the geometry names are unique;
    • name – Optional geometry name;
    • vertices – Array of vertices containing latitude and longitude.

An example of a request can be seen 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
                }
            ]
        }
    ]
}

Once the message "201 - Restriction zone successfully created" has been received, the restricted zone can be consulted and used with the Trip, Planning or Distance Matrix APIs.