Map Matching API - match a GPS track to roads

Reconstruct a route for a given GPS coordinates, get route details for each segment - road class, surface, speed limit, number of lanes and more

Features and options

Different modes, big volumes support and detailed information for route segments

Different transportation modes

Travel modes

The Map Matching API accepts GPS-track of different travel modes - 'drive', 'walk', 'bicycle'. The API constructs a route according to restrictions and limits for the travel mode provided. For example, it paves the drive route only on a driving road, a bicycle route can contain bicycle roads.

Supports a large number of GPS positions

A large number of GPS positions in one request

The API works via HTTP Post request that allows passing big volumes of data. So Geoapify Map Matching API is capable to process a large number of GPS coordinates in one request.

Details for each route segment

Detailed information about the route

The API returns route geometry as well as detailed information about the route and its segments including road type, surface, restrictions, and other useful information.

Use cases and examples

Learn how can your business benefit using Map Matching API

Route visualization, South Anston, UK

Reconstruct a route and visualize it

The Map Matching API spans GPS-position to existing streets and roads and returns estimated route. So the route and its segments can be visualized on the map.

Motorway route details

Analyse the route

Together with route geometry the API returns detailed information about route segments as well as information about travel time. This lets analyse the route and traffic conditions.

Detect going over speed limits

Detect dangerous driving style

By providing timestamps for each GPS position you get actual speed for each road segment as the results. In combination with speed limits and road restrictions information that may help to detect dangerous dring and non-observance of traffic rules.

Getting started

Step 1. Register and get an API Key

You will require an API Key to use the API. Register on MyProject Geoapify and get an API key.

Step 2. Generate HTTP Post request

Generate an HTTP Post request with input data and make the call. Use our Playground and Documentation learn about Map Matching API request/response structure.

Here is an example of generating a request from GPX-track:

const data = {
      mode: 'drive', // or 'walk' or 'bicycle'
      waypoints: gpxTrackToWaypoints(gpxJSONObject)
}

fetch('https://api.geoapify.com/v1/mapmatching?apiKey=YOUR_API_KEY', {
  method: 'post',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify(data)
}).then(res=>res.json())
  .then(result => console.log(result));
Step 3. Process or visualize results

The API returns a FeatureCollection GeoJSON object. As GeoJSON is natively supported by map client libraries the result can be easily visualized on the map. Find code samples of Map Matching API data processing and GeoJSON visualization on Geoapify APIDocs.

FAQ

How much does the Map Matching API cost?

The Map Matching API requests belong to the "Routing" requests group. Every 100 waypoints are billed as a separate request. Learn more about the API pricing on the API Documentation page.

Which data sources do you use for the road details?

The road details provided in the API response are based on OpenStreetMap data.

How detailed should be a GPS track to get satisfactory results?

This depends on the accuracy of the GPS track and travel mode. Our Playground allows loading custom GPX tracks, that lets you experiment and find the optimal input quality for your case.

World map

Register and try Geoapify Map Matching API now!

Contact us if you have questions and we will be happy to help you!