Calculate distance and coordinates from xMapMatch result

This forum deals with mapmatching.
Post Reply
julonska
Posts: 9
Joined: Thu Aug 09, 2018 1:37 pm

Calculate distance and coordinates from xMapMatch result

Post by julonska »

Hi there,

probably you can help me with our current use case:

We want to display the actual driven road on a map with help of xMapMatch and get distance and toll of this exactly route.
For this we currently do the following steps:
  • - a third party software sends us a GPS track (coordinate array) (result --> see the blue track in the screenshot)
    - I am mapping this to the xMapMatch request structure to call the webservice method matchTrackExtended (result --> see the red track in the screenshot)
    - After this I am taking the xMapMatch response to call calculateExtendedRoute to receive toll and distance for this track.
Since I am recalculating the route with the webservice call (calculateExtendedRoute), the result differs a lot to the input track.

Therefore, my question:
Is it possible to calculate distance and toll with an exact input route (xMapMatch result)? I would need to avoid a recalculation to have exact results.

Many thanks!
If you have any further questions do not hesitate to ask me.

Julian Ulonska
Attachments
2019-08-02 11_08_29-ZASBWB - Routenvisualisierung.png
2019-08-02 11_07_06-ZASBWB - Routenvisualisierung.png
Joost
Posts: 310
Joined: Fri Apr 25, 2014 1:46 pm

Re: Calculate distance and coordinates from xMapMatch result

Post by Joost »

If you want the exact result do not use the coordinates but the segment information. See https://xserver.ptvgroup.com/forum/view ... ?f=8&t=861 for an explanation on how to do this.

General note: when looking at your input signal getting a good match will be difficult. The points are far away and there are a few points with a relative high drift. if you only get coordinates from your provider this will be an issue. If you receive more information like heading or data quality then it becomes easier to solve.
Joost Claessen
Senior Technical Consultant
PTV Benelux
julonska
Posts: 9
Joined: Thu Aug 09, 2018 1:37 pm

Re: Calculate distance and coordinates from xMapMatch result

Post by julonska »

I was just wondering how to handle the mapping to the expected structure for webservice method "calculateExtendedRoute".

If I have a look at the input structure from Raw Request Runner, I am not sure which data I should use from xMapMatch and where should I put it into the request.
Also in other methods I could not find any webservice method which works with segment information...

calculateExtendedRoute Input Structure:

Code: Select all

{
  "waypoints": [
    {
      "coords": [
        {
          "point": {
            "x": 685903,
            "y": 6372958
          }
        }
      ],
      "linkType": "NEXT_SEGMENT"
    },
    {
      "coords": [
        {
          "point": {
            "x": 681013,
            "y": 6371680
          }
        }
      ],
      "linkType": "NEXT_SEGMENT"
    }
  ],
  "options": [],
  "exceptionPaths": [],
  "details": {
    "binaryPathDesc": false,
    "boundingRectanglesC": 5,
    "boundingRectanglesOffset": 300,
    "brunnelManoeuvres": false,
    "detailLevel": "STANDARD",
    "dynamicInfo": false,
    "manoeuvreAttributes": false,
    "manoeuvreGroupRatio": 1,
    "manoeuvreGroups": true,
    "manoeuvres": true,
    "nodes": false,
    "polygon": true,
    "segmentAttributes": false,
    "segments": true,
    "texts": true,
    "totalRectangle": false,
    "urbanManoeuvres": false
  },
  "countryInfoOptions": {
    "allEuro": false,
    "detailedTollCosts": true,
    "reductionIDs": []
  },
  "callerContext": {
    "properties": [
      {
        "key": "ResponseGeometry",
        "value": "PLAIN"
      },
      {
        "key": "CoordFormat",
        "value": "PTV_MERCATOR"
      },
      {
        "key": "Profile",
        "value": "truckfast"
      }
    ]
  }
}
Furter:
Our provider is returning heading and speed as well, but we only receive a GPS coordinate every 30 seconds. Probably we should decrease this to 5-10 seconds?
Joost
Posts: 310
Joined: Fri Apr 25, 2014 1:46 pm

Re: Calculate distance and coordinates from xMapMatch result

Post by Joost »

About the signal rate: 30 sec in combination with heading and speed is fine. The default profile is a good starting point for matching , although probably you'll need to tweak it later on based on how good the signal really is.

The raw request runner example won't help you with this case, since they all use coordinates as input. Using segment ID structure is not practical for us since the ID are connected to a map so the samples will not work the moment the map is changed.

I have attached a set sample requests for a small track that is being matched by xMapmatch and then the result passed to xRoute.
Attachments
json request and response sample.zip
(13.94 KiB) Downloaded 588 times
Joost Claessen
Senior Technical Consultant
PTV Benelux
Post Reply