Back to TomTom in Google Sheets
SheetXAI logo
TomTom logo
TomTom · Google Sheets Guide

Snap Raw GPS Traces to Road Geometry From a Google Sheet Using TomTom

2026-05-15
5 min read

The Scenario

A colleague who left the team six months ago set up a GPS tracking integration for the delivery fleet. The raw coordinate data has been streaming into a Google Sheet ever since — 300 points from yesterday's route. The problem: the tracker records GPS positions every 30 seconds regardless of whether the vehicle is moving, and the raw points jump off the road constantly. Before you can load them into the route compliance tool, they need to be snapped to the actual road network. Your colleague's setup notes say "TomTom snap-to-roads" and nothing else.

The bad version:

  • Find TomTom's map-matching API documentation, understand the request format, write a call for the first batch of coordinates, parse the corrected points out of the response, paste them back into the right rows in the sheet
  • The API accepts coordinates in batches of 100, so three calls for 300 points, each requiring you to track which rows correspond to which batch
  • Misalign the third batch by two rows and produce a corrected trace where the last 50 points are mapped to the wrong road segments

The compliance tool import is scheduled for tomorrow morning.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It reads the raw GPS coordinates, calls TomTom's snap-to-roads endpoint in the batches it requires, and writes the corrected coordinates and road names back into the sheet.

Take the raw lat/lng GPS points in columns A and B of this sheet and snap them to the TomTom road network. Write the corrected lat/lng coordinates into columns C and D and the matched road name into column E.

What You Get

  • Column C: corrected latitude snapped to the nearest road
  • Column D: corrected longitude snapped to the nearest road
  • Column E: name of the matched road segment
  • Original coordinates in columns A and B preserved for comparison
  • Any points TomTom couldn't match flagged visibly rather than silently dropped

What If the Data Is Not Quite Ready

Coordinates are timestamped and out of sequence

Sort the GPS points in this sheet by the timestamp in column C, then take the lat/lng pairs in columns A and B in the sorted order and snap them to the TomTom road network. Write corrected lat/lng into columns D and E and matched road name into column F.

Some points are clearly erroneous (speed implies teleportation)

For each consecutive pair of GPS points in columns A and B, calculate the implied speed in km/h based on the timestamps in column C. Remove any point where implied speed exceeds 200 km/h as an erroneous reading, then snap the remaining points to the TomTom road network and write corrected coordinates into columns D and E.

You also need the speed limit for each matched road

For each GPS coordinate pair in columns A and B of my Excel sheet, use TomTom snap-to-roads to map the point to the nearest road and write the corrected latitude, longitude, and road name into columns C, D, and E.

Full trace cleanup and snap in one operation

Take the raw GPS points in columns A and B. Filter out any point where the timestamp in column C is more than 30 seconds from the previous row (likely a gap in tracking). Snap the remaining points to the TomTom road network and write corrected lat/lng into columns D and E and matched road name into column F. Flag any unmatched point in column G with "no match".

One prompt handles the gap filtering, the snap, and the unmatched flagging together.

Try It

Get the 7-day free trial of SheetXAI and open the Google Sheet with your raw GPS trace, then ask it to snap the coordinates to TomTom road geometry. For bulk geocoding street addresses rather than correcting GPS traces, see the address geocoding spoke.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more