Skip to content

Match-tolls

matchingtolls


Get a list of GPS coordinates from a mobile device or a vehicle tracking device that has moved (lat, long). This GPS list is calculated by the Match-tolls API to give the route that best matches the actual route data and the list of toll stations, the amount corresponding to the type of vehicle in the input parameters.

URL

https://maps.vietmap.vn/api/match-tolls?api-version=1.1&apikey={your-apikey}&vehicle={vehicle}

Method

POST

Parameters

Parameter Type Required Default Description
apikey array string yes none API provided by VIETMAP for customer's account.
vehicle number no 1
  • = 1 (Applicable to passenger cars: seats < 12; trucks: gross tonnage <2 tons)
  • = 2 (Applicable to passenger cars: seats <= 30; trucks: gross tonnage < 4 tons)
  • = 3 (Applicable to passenger cars: seats > 31; trucks: total tonnage < 10 tons; tractors: not towing containers)
  • = 4 (Applicable to trucks: gross tonnage < 18 tons; tractor trucks: containers <= 20 feet);
  • = 5 (Applicable to trucks: gross tonnage >= 18 tons; tractors: containers > 20 feet)

Example

URL:
https://maps.vietmap.vn/api/match-tolls?apikey=”your-apikey”&vehicle={vehicle}

body:
[
    [
      106.95087864374692,  10.766492031716632
    ],
    [
      106.9543655, 10.765222
    ],
    [
       106.9634635679679, 10.765469652640904
    ]
]

JSON Output

{
    "path": [
        [
            106.95086475799218,
            10.766439390965505
        ],
        /// More LngLat to present the route here ....
        [
            106.96348491002774,
            10.765226602544725
        ]
    ],
    "distance": 1.423762672514766,
    "tolls": [
        {
            "id": 466,
            "name": "Trạm Thu Phí Quốc Lộ 51",
            "address": "Cao Tốc Hồ Chí Minh Long Thành Dầu Giây",
            "type": "",
            "price": 0,
            "prices": null
        },
        {
            "id": 396,
            "name": "Trạm Thu Phí Quốc Lộ 51",
            "address": "Cao Tốc Hồ Chí Minh Long Thành Dầu Giây",
            "type": "entry",
            "price": 0,
            "prices": null
        }
    ]
}

Response description

Parameter Type Description
path array Array containing coordinate pairs along the route
distance float Total distance of the route (in kilometers)
tolls array Array containing toll booth information along the route

For the path array:

Sub-Parameter Type Description
[longitude, latitude] array of floats Coordinate pair representing a point on the route

For the tolls array:

Sub-Parameter Type Description
id integer Unique identifier for the toll booth
name string Name of the toll booth
address string Address of the toll booth
type string Type of toll booth (entry, exit, etc.)
price integer Toll price in local currency
prices null Additional price information (if available)