Use Cases > PTV xMapmatch > How to Use matchPositions

How to Match GPS Tracks Selecting Additional Parameters

This example illuminates how to obtain the complete result list including polylines for visualization and considering the result list options which have to be enabled according to the API. Please notice that the basic elements are described in the code sample: How to match GPS tracks in principle.

PTV recommends that the deprecated methods are replaced by using matchPositions for future development tasks. The enhancement of attributes is simply applicable without violating the downwards compatibility.

Create object ResultListOptions

Define the following attributes to be enabled:

Call matchPositions

The method contains two mandatory arguments as follows:

Output

The match result contains the above named properties in addition. Visualize the polyline and list the detailed information in a corresponding table.

Plot Results

The matched segments are displayed by the corresponding polyline.

Matched positions

The following table exemplarily illustrates the relevant attributes including the already mentioned details: speed class and vendorID.

Detailed result list