Route Match Extension API Developer's Guide

Route from GPS Trace

To get the most probable route for a small GPS trace, zip and Base64-encode the following GPX file
<?xml version="1.0"?>
<gpx version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.topografix.com/GPX/1/0"
xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
  <trk>
    <trkseg>
      <trkpt lat="51.10177" lon="0.39349"/>
      <trkpt lat="51.10181" lon="0.39335"/>
      <trkpt lat="51.10255" lon="0.39366"/>
      <trkpt lat="51.10398" lon="0.39466"/>
      <trkpt lat="51.10501" lon="0.39533"/>
    </trkseg>
  </trk>
</gpx>
and submit it in a GET request:
https://rme.cit.api.here.com/2/matchroute.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&routemode=car
&file=UEsDBBQAAAAIANmztEQSwaeZzwAAAM8BAAAQAAAAc2FtcGxlLXRyYWNlLmdweIXPTQuCM
BwG8HufQnZv%2F605S0k9djEIungdZjpSJ27kPn6%2BRBgYXcYYv2cPzzG2deU8805L1YSIYoLiaHMs
Wvv9uBlYowOrZYhKY9oAoO973DOsugJ2hFBIz8k1K%2FNabGWjjWiy%2FJ36ShjVqqITd2lxpmo4XVK
gMP6vZaCneKIyYabivzHnr4BhCbb6hoZRpnvMp86L%2BdIapxImRJxiSuh%2Bj5xq7CWY%2Bcz1Eayp
A10qxlfVjvOl8rxVxfzDQrk%2FFCfLRs7YpOCzA%2BZd49LoBVBLAQIUABQAAAAIANmztEQSwaeZzwA
AAM8BAAAQAAAAAAAAAAEAIAAAAAAAAABzYW1wbGUtdHJhY2UuZ3B4UEsFBgAAAAABAAEAPgAAAP0AAA
AAAA%3D%3D
The response to the above request includes a JSON object with the following high level elements:
  • sections of the route represented by RouteLinks
  • GPS trace points regarded in the route match
  • information about prohibited sections of the route represented by Warnings
  • currently used map status version
{
  RouteLinks: [
  {
    linkId: 25664478,
    functionalClass: 5,
    shape: "51.1017723 0.3934907 51.1018066 0.3933491 51.1018295 0.39326",
    linkLength: 15.575699313408467
  },
  {
    linkId: 25664473,
    functionalClass: 4,
    shape: "51.1018295 0.39326 51.1022491 0.39348",
    linkLength: 44.17562556306323
  },
  {
    linkId: 25664459,
    functionalClass: 4,
    shape: "51.1022491 0.39348 51.1022987 0.39351",
    linkLength: 5.305684979980019
  },
  {
    linkId: 781742854, 
    functionalClass: 4, 
    shape: "51.1022987 0.39351 51.1025505 0.39365", 
    linkLength: 26.670487136749067
  },
  {
    linkId: 781742855, 
    functionalClass: 4, 
    shape: "51.1025505 0.39365 51.1027794 0.39378", 
    linkLength: 24.302012297623005
  },
  {
    linkId: 25664450,
    functionalClass: 4,
    shape: "51.1027794 0.39378 51.1030807 0.39403",
    linkLength: 33.974229462422905
  },
  {
    linkId: 25664444,
    functionalClass: 4,
    shape: "51.1030807 0.39403 51.103241 0.39413",
    linkLength: 17.215963662407898
  },
  {
    linkId: 25664440,
    functionalClass: 4,
    shape: "51.103241 0.39413 51.1033783 0.39421 51.1035385 0.39433 51.1036797 0.39445",
    linkLength: 48.32839625333388
  },
  {
    linkId: 25664427,
    functionalClass: 4,
    shape: "51.1036797 0.39445 51.1038017 0.39454",
    linkLength: 13.445306290244636
  },
  {
    linkId: 860272608,
    functionalClass: 4,
    shape: "51.1038017 0.39454 51.1039391 0.39465",
    linkLength: 15.378381014646559
  },
  {
    linkId: 860272609,
    functionalClass: 4,
    shape: "51.1039391 0.39465 51.1041908 0.39484",
    linkLength: 27.85427285471891
  },
  {
    linkId: 781742870,
    functionalClass: 4,
    shape: "51.1041908 0.39484 51.1043282 0.39494 51.1045609 0.39506",
    linkLength: 39.56626207722863
  },
  {
    linkId: 781742871,
    functionalClass: 4,
    shape: "51.1045609 0.39506 51.1047287 0.39515 51.1050262 0.3953021",
    linkLength: 48.951382959921716
  }
],
TracePoints: [
  {
    confidenceValue: 1, linkIdMatched: 25664478, matchDistance: 1.46,
    routeLinkSeqNrMatched: 0, lat: 51.10177, lon: 0.39349,
    elevation: 0, speedMps: 0, headingDegreeNorthClockwise: 10000,
    latMatched: 51.10178065190155, lonMatched: 0.3934977183445852,
    timestamp: 0, headingMatched: 114.46568884011239,
    minError: 1.3027890756593314
  },
  {
    confidenceValue: 1, linkIdMatched: 25664478, matchDistance: 1.57,
    routeLinkSeqNrMatched: 0, lat: 51.10181, lon: 0.39335,
    elevation: 0, speedMps: 0, headingDegreeNorthClockwise: 10000,
    latMatched: 51.10182, lonMatched: 0.39336,
    timestamp: 0, headingMatched: -65.53429247174023,
    minError: 1000000
  },
  {
    confidenceValue: 1, linkIdMatched: 781742854, matchDistance: 1,
    routeLinkSeqNrMatched: 4, lat: 51.10255, lon: 0.39366,
    elevation: 0, speedMps: 0, headingDegreeNorthClockwise: 10000,
    latMatched: 51.102547928304084, lonMatched: 0.3936687569824506,
    timestamp: 0, headingMatched: 20.644254301899522,
    minError: 0.6541474931313044
  },
  {
    confidenceValue: 1, linkIdMatched: 860272608, matchDistance: 4.59,
    routeLinkSeqNrMatched: 10, lat: 51.10398, lon: 0.39466,
    elevation: 0, speedMps: 0, headingDegreeNorthClockwise: 10000,
    latMatched: 51.10394, lonMatched: 0.39465,
    timestamp: 0, headingMatched: 25.217234923243595,
    minError: 1.2405405512432781
  },
  {
    confidenceValue: 1, linkIdMatched: 1022687693, matchDistance: 1.33,
    routeLinkSeqNrMatched: 14, lat: 51.10501, lon: 0.39533,
    elevation: 0, speedMps: 0, headingDegreeNorthClockwise: 10000,
    latMatched: 51.105012239590245, lonMatched: 0.39531827230152644,
    timestamp: 0, headingMatched: 16.91643828307876,
    minError: 0.8568378930601925
  }
],
Warnings: [
  {
    "tracePointSeqNum": -1,
    "routeLinkSeqNum": 3,
    "category": 3,
    "text": "Entering link 781742854 into forbidden driving direction"
  }
],
MapVersion: "2013Q4" }