Map Matching API to snap geo coordinates to roads

Map Matching API - Snap GPS Data To Roads

Match GPS data to road networks for detailed route analysis

Map Matching API processes raw GPS data and aligns it with a road network, considering factors such as the direction of travel, road speed limits, and other contextual information.

Furthermore, the Map Matching API provides detailed information about the route, including road class, surface type, speed limit, number of lanes, and estimated drive time.

The Map Matching API can be useful in a variety of applications, such as fleet management, logistics, transportation, and location-based services. By snapping to roads and aligning raw GPS data with road networks, the API provides detailed information about the route, enabling more accurate and efficient route planning, improved safety, and enhanced navigation experiences.

Try Map Matching API

Try out the Geoapify Map Matching API below. Choose your track from the dropdown then click “match to roads”. See the GPS route on a map, and hover over individual steps to see details for each.

Explore our Map Matching API Playground to test various tracks or upload your own.

Use Cases

Map matching has lots of benefits for your business:

  • Route Analysis: Gain insights into driving times and conditions.
  • Route Comparison: Identify faster, safer, or easier routes to drive.
  • Risk Assessment: Conduct thorough evaluations to mitigate risks.
  • Driving Behavior Monitoring: Detect and address dangerous driving styles.

By using map matching algorithms to snap GPS locations to roads you can get detailed statistics. Those statistics help you make better decisions for your drivers and fleet. The vehicle tracking market is growing with an expected CAGR of 20% by 2025. More and more companies are seeing the benefits of technology like our Map Matching API to keep their drivers and customers safe, and provide a better service.

Route visualization, South Anston, UK

Snap To Road with API and Visualize Routes

Our API analyzes GPS information and maps it to existing streets and roads. The API returns the route the vehicle took, and lets you see that route on a map.

Maybe you have a fleet of delivery trucks dropping off parcels around Edinburgh, Scotland. You know some of the city center streets are narrow and difficult to navigate, so you've constructed routes that you know are safe for your delivery trucks. Use Map Matching API to see the routes for yourself and help decide which ones are more convenient for your fleet.

Motorway route details

Analyze Routes

Map matching API returns lots of information about a route, including road class and surface, number of lanes, travel time and speed limit.

Say you have a home cleaning service located on the outskirts of Hamburg, Germany. You can use Map Matching API to analyze the routes your team is using. Now you can see which ones give them quickest access to different parts of the city, which ones have low speed limits that could slow them down, and which roads have the best surfaces.

Detect going over speed limits

Detect Dangerous Driving Styles

Map Matching API provides timestamps for each GPS position so you can see the actual speed for each road segment. You can combine that information with the speed limit and road restrictions information returned by the API. Now you can see if any of your fleet might be driving dangerously or not observing traffic rules.

This makes a big difference, with 42% of companies seeing fewer safety accidents after monitoring driver behavior.

Features and Capabilities

Easy-to-use and solid

The API works via HTTP Post request, so you can input large volumes of data in one request. This lets you process a large number of GPS coordinates and visualize the corresponding routes.

Travel modes

Use our API to analyze different travel modes. Our map matching algorithm for GPS data accepts GPS tracks for driving, walking and cycling. The API constructs the route based on the restrictions and limits for the travel mode provided.

For example, for a driving route it will only show driving roads. For a bicycle route it will add in bicycle roads, and block areas where bicycles cannot go.

Go deeper by specifying the vehicle type. For example, light, medium, or heavy trucks, or those carrying dangerous goods. Specify bicycle, road bicycle, mountain bike, or a scooter or motorcycle. Search for public transport routes only, or those with bus lanes.

Get detailed route information

The Snal To Roads API returns detailed route information including road type, surface, time, speed limits and restrictions. Use the information to make your existing routes better, or to adjust routes to get more drivable options.

Getting started

Step 1. Register and Get an API Key

You'll need an API key to use our Map Matching API. Register on MyProjects Geoapify and get an API key.

Step 2. Generate HTTP POST Request

Generate HTTP Post request. Generate an HTTP Post request with input data and make the call. Visit the Playground and Documentationto 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 and Visualize Results

The API will return 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.

Pricing

Our pricing model is simple and easy to understand. We use a credit-based system to unify the cost for different APIs.

For every 100 waypoints snaped to roads, by the Map Matching API, one credit is used. So, 100 waypoints = 1 credit.

You can get started with the API right away with our free plan, which provides you with 3,000 credits per day. If you need more credits, you can easily upgrade your plan to accommodate your needs.

Not sure which plan is right for you? Get in touch and we'll help you figure out which solution you need. You can learn more about pricing on the Pricing Details page.

FAQ

What is the Map Matching API?

The Map Matching API processes raw GPS data and aligns it with a road network, considering factors such as the direction of travel, road speed limits, and other contextual information. This enables you to snap to roads accurately, enhancing the quality and usability of your GPS data.

How does the Map Matching API snap to roads?

The API uses advanced algorithms to align your GPS data with the most accurate road segments. It considers various factors such as travel direction, speed limits, and road conditions to ensure the GPS data matches the actual road network.

What does snap to road mean?

In the context of GPS data processing, "snap to road" means aligning a GPS point to the nearest point on a road network. This process involves matching the GPS point to the most likely road segment based on various factors such as the direction of travel, speed limits, and other contextual information. By snapping the GPS point to the nearest road segment, it becomes easier to analyze and visualize the corresponding route and estimate factors such as travel time, distance, and speed. This process is typically done using a map-matching algorithm, such as the one used by the Geoapify Map Matching API.

How is Map Matching different from the Routing API?

Map Matching takes raw GPS locations and snaps them to roads to align with the actual road network. In contrast, the Routing API builds a route between given locations, providing turn-by-turn directions and optimal paths based on various criteria

Which data sources do you use to get road details?

We use OpenStreetMap data to give the API results, which contains the most up-to-date road network information. This ensures that you have access to accurate and reliable data to process your GPS coordinates and align them with the road network.

How detailed a GPS track do I need to put in to get satisfactory results?

It depends on the accuracy of the GPS track and travel mode. You can upload custom GPX tracks on our Playground. Try it out and see what the optimal input quality is for your use case.

How does the Map Matching API complement the Route Matrix API?

The Map Matching API complements the Distance Matrix API by providing accurate alignment of GPS data to road networks, ensuring that the input locations for the Route Matrix API are precise. While the Map Matching API snaps raw GPS data to the nearest roads, the Route Matrix API calculates travel times and distances between multiple points. Together, they enhance the accuracy and reliability of routing and logistics solutions, enabling more efficient route planning and analysis.

Can I get route information tailored to different types of vehicle?

Of course. Our API can return route information for driving, walking, or cycling.

How to create GPS route from GPX file?

If you already have GPS data in the form of a GPX file, you can use the Map Matching API to align the raw GPS data with the road network and get more accurate information about the route, including road class, surface type, speed limit, number of lanes, and estimated drive time.

World map

Try Map Matching API now!

Get accurate and detailed route information from GPS inputs.

Register an API key and get started for free today. Got questions? Get in touch and we'll help you get started.