Skip to content

Map Data

The endpoints starting with /mapdata are used to query information from the map data.

Querying Road Segments

This endpoint [GET]/mapdata/roadsegments/geojson/{coordinate} is especially useful when used with the Detour functions prioritize and penalize: Before adjusting the priority of a road, you can check what speed the navigation uses on this road segment.

Important

The speed values returned by this endpoint are just an average base value. The speed value used by MapTrip and route calculations may differ from this and depend on the day of the week, the time and the current traffic situation.

You can query the road segments at a coordinate, e.g. 50.7365574, 7.0919497, like this:

curl -X GET "https://api.maptrip.de/v1/mapdata/roadsegments/geojson/50.7365574%2C%207.0919497?provider=TomTom" -H "accept: application/json" -H "Authorization: Bearer <token>"

The result is a GeoJSON feature collection. For this example the response contains a single road segment (but there can be more segments for other coordinates, e.g. for crossroads):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            7.092882,
            50.737243
          ],
          [
            7.092567,
            50.737067
          ],
          [
            7.092469,
            50.736999
          ],
          [
            7.092388,
            50.736925
          ],
          [
            7.091912,
            50.736356
          ]
        ]
      },
      "properties": {
        "NAME": "Weiherstra├če",
        "TYPE": "ICB",
        "SPEED": "9"
      }
    }
  ]
}

The SPEED property is the average speed for this road segment in km/h.

Querying Turn Restrictions

To easily visualize turn restrictions in a map, you can use the endpoint [GET] /mapdata/turnrestrictions/geojson/{from}/{to} which returns a GeoJSON feature collection to show in a map:

curl -X GET "https://api.maptrip.de/v1/mapdata/turnrestrictions/geojson/50.73614%2C7.09503/50.73756%2C7.09732?provider=tomtom" -H "accept: application/geo+json" -H "Authorization: Bearer <token>"

Querying Vehicle Attributes

To visualize vehicle attributes like height or weight limits in a map, you can use the endpoint [GET] /mapdata/vehicleattributes/geojson/{from}/{to} which returns a GeoJSON feature collection to show in a map:

curl -X GET "https://api.maptrip.de/v1/mapdata/vehicleattributes/geojson/50.73614%2C7.09503/50.73756%2C7.09732?provider=tomtom" -H "accept: application/geo+json" -H "Authorization: Bearer <token>"