GPX Track Simplifier

Reduce GPX track-point count with Ramer-Douglas-Peucker — keep shape, lose bloat

Apply the Ramer-Douglas-Peucker algorithm to a GPX track with a configurable epsilon (in metres) to cut point count while preserving route shape. Shows before and after point counts and a downloadable simplified GPX. Fully in-browser. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What does the epsilon value mean?

Epsilon is the maximum distance, in metres, that any removed point may sit from the simplified line. A point is kept only if dropping it would move the route by more than epsilon, so a larger epsilon removes more points.

GPX Track Simplifier trims redundant GPS points from a recorded track using the classic Ramer-Douglas-Peucker (RDP) algorithm. Long recordings often log a point every second, producing huge files with far more detail than any map needs. This tool removes points that lie close to the straight line between their neighbours, shrinking the file while keeping the visible route shape intact — all in your browser, with nothing uploaded.

How it works

RDP works recursively on each track segment. Given the segment’s first and last points, it finds the intermediate point with the greatest perpendicular distance from the line connecting them. If that distance exceeds epsilon, the point is kept and the segment is split in two at that point, with the algorithm applied to each half. If no point exceeds epsilon, every intermediate point is discarded and only the endpoints remain.

Because GPS coordinates are in degrees, the tool converts them to metres before measuring distance. It uses a local equirectangular projection: longitude is scaled by cos(latitude) to account for meridian convergence, and both axes are multiplied by metres-per-degree. Perpendicular distance is then computed on that flat plane, making the epsilon comparison meaningful in real-world metres.

Tips and example

Start with an epsilon of around 5–10 metres for hiking or cycling tracks — that typically removes the majority of points with no visible change at normal zoom. Increase it for overview maps where fine wiggles do not matter, and decrease it for technical routes where every switchback counts. The endpoints of each segment are always preserved, so a closed loop stays closed. Try the sample track, then adjust epsilon and watch the retained-point count fall.

Why you would simplify a GPX track

File size and load time

Modern GPS devices log a point every second. A two-hour hike at 1Hz produces 7,200 track points. For a web map that renders a hiking route, the vast majority of those points add zero visible information at any zoom level a user will use. Simplifying to 500 or 200 points creates a file one-tenth the size that loads and renders faster without any perceptible difference in route shape.

API and processing limits

Some mapping APIs cap the number of coordinate pairs in a GeoJSON or KML object. Web map tile renderers may have polygon vertex limits. Database geometry column operations scale with point count. A simplified track stays well inside these limits and processes faster in spatial queries.

Choosing the right epsilon

The right epsilon depends on what the track will be used for:

Use caseSuggested epsilonTypical point reduction
High-precision technical route (climbing, MTB)1–3 m30–50%
Standard hiking or cycling route5–10 m60–80%
Driving route / road navigation overview20–50 m85–95%
City/country level overview map100–500 m95–99%

These are rough starting points. Always inspect the output at your target zoom level before using it in production.

Understanding the algorithm

Why RDP outperforms random downsampling

A naive approach to reducing point count is to keep every nth point. This is simple but poor: it ignores the geometry and can drop critical points at bends and switchbacks while retaining redundant points on straight sections. RDP does the opposite — it selectively removes points that are geometrically redundant (those on or near straight line segments) and preserves points at bends and direction changes where they contribute information. The result is a smaller track that preserves route shape far better than random thinning.

What happens at segment boundaries

Each trkseg in the GPX is processed independently. The first and last point of each segment are always preserved — this ensures that segment starts and ends connect correctly if you later recombine them. A multi-day hike with daily track segments will simplify each day’s segment independently and preserve the handoff points.

Elevation and time preservation

The simplifier keeps every attribute on the surviving points — elevation, timestamps, and any extension data in the original GPX. Only the point itself is removed or retained; the surviving points are passed through unchanged. This means the simplified track remains valid input for a lap timer, elevation profile tool, or any other processor that reads time and elevation data.