Custom Route Extension API Developer's Guide

Calculate a Route

The user wants to compute a route from the North of the blocked bridge to the Southern side.

Request

 GET http://cre.cit.api.here.com/2/calculateroute.json
  ?waypoint0=50.10951,8.68951
  &waypoint1=50.10703,8.68222
  &mode=fastest;car;traffic:disabled
  &overlays=MY_OVERLAY_MAP
  &storage=readonly
  &app_id={YOUR_APP_ID}
  &app_code={YOUR_APP_CODE}

Response

The response to the request contains following information blocks:
  • meta information such as the timestamp and map version
  • a list of waypoints, each with a linkId and detailed information such as its mappedPosition, originalPosition, the type of waypoint, and so on
  • transport mode
  • a list of maneuvers, each with a position and instruction
  • a list of links, each with a shape, remainTime, speedLimit, functionalClass, and _type
{
  "response": {
  "metaInfo": {
    "timestamp": "2017-04-18T09:10:11Z",
    "mapVersion": "8.30.69.151",
    "moduleVersion": "7.2.201714-120544",
    "interfaceVersion": "2.6.29"
  },
  "route": [
    {
    "waypoint": [
      {
      "linkId": "+52309232",
      "mappedPosition": {
        "latitude": 50.1095094,
        "longitude": 8.6895098
      },
      "originalPosition": {
        "latitude": 50.1095099,
        "longitude": 8.68951
      },
      "type": "stopOver",
      "spot": 0.8939394,
      "sideOfStreet": "neither",
      "mappedRoadName": "Schöne Aussicht",
      "label": "Schöne Aussicht",
      "shapeIndex": 0
      },

      ... more waypoints ...
     
    ],
    "mode": {
      "type": "fastest",
      "transportModes": [
      "car"
      ],
      "trafficMode": "disabled",
      "feature": []
    },
    "leg": [
      {
      "start": {
        "linkId": "+52309232",
        "mappedPosition": {
        "latitude": 50.1095094,
        "longitude": 8.6895098
        },
        "originalPosition": {
        "latitude": 50.1095099,
        "longitude": 8.68951
        },
        "type": "stopOver",
        "spot": 0.8939394,
        "sideOfStreet": "neither",
        "mappedRoadName": "Schöne Aussicht",
        "label": "Schöne Aussicht",
        "shapeIndex": 0
      },
      "end": {
        "linkId": "-52309625",
        "mappedPosition": {
        "latitude": 50.1070309,
        "longitude": 8.6822195
        },
        "originalPosition": {
        "latitude": 50.10703,
        "longitude": 8.68222
        },
        "type": "stopOver",
        "spot": 0.5853659,
        "sideOfStreet": "neither",
        "mappedRoadName": "Schaumainkai",
        "label": "Schaumainkai - B43",
        "shapeIndex": 37
      },
      "length": 1895,
      "travelTime": 254,
      "maneuver": [
        {
        "position": {
          "latitude": 50.1095094,
          "longitude": 8.6895098
        },
        "instruction": "Head <span class=\"heading\">west</span> on <span class=\"street\">
          Schöne Aussicht</span>. <span class=\"distance-description\">
          Go for <span class=\"length\">13 m</span>.</span>",
        "travelTime": 50,
        "length": 336,
        "id": "M1",
        "_type": "PrivateTransportManeuverType"
        },
        {
        "position": {
          "latitude": 50.1114428,
          "longitude": 8.6882436
        },
        "instruction": "Turn <span class=\"direction\">right</span> onto 
          <span class=\"next-street\">Börneplatz</span>. <span class=\"distance-description\">
          Go for <span class=\"length\">319 m</span>.</span>",
        "travelTime": 64,
        "length": 319,
        "id": "M2",
        "_type": "PrivateTransportManeuverType"
        },

        ... more maneuvers ...
      ],
      "link": [
        {
        "linkId": "+52309232",
        "shape": [
          50.1095094,
          8.6895098,
          50.1095223,
          8.6893272
        ],
        "remainTime": 254,
        "speedLimit": 13.8888893,
        "functionalClass": 3,
        "_type": "PrivateTransportLinkType"
        },

        ... more lines ...
      ]
      }
    ],
    "summary": {
      "distance": 1895,
      "trafficTime": 350,
      "baseTime": 254,
      "flags": [
      "builtUpArea",
      "park"
      ],
      "text": "The trip takes <span class=\"length\">1.9 km</span> and <span class=\"time\">4 mins</span>.",
      "travelTime": 254,
      "_type": "RouteSummaryType"
    }
    }
  ],
  "language": "en-us"
  },
  "warnings": [
  {
    "message": "Suspicious u-turn onto link 52309195",
    "code": 2
  }
  ]
}