TrailFix: Browser-Based GPS Post-Processing Without the $1,000 Upgrade
How I built a client-side GPS post-processor that gets sub-meter accuracy from a Bad Elf Flex Mini Standard — using position averaging, Kalman smoothing, and free NOAA CORS data.
The Bad Elf Flex Mini Standard and Extreme use identical hardware — same GNSS chip, same dual-frequency L1/L5 antenna. The $1,000 price difference is a firmware unlock for RTK and improved SBAS. For hobby use like trail mapping and dirt bike routes, I wanted to see how close I could get with post-processing and free reference data. The answer: pretty close.
The Processing Pipeline
TrailFix runs entirely in the browser — no server, no uploads, no accounts. You drop a GPX or NMEA file and it runs through four stages:
Speed filter removes GPS spikes. Consumer GNSS receivers occasionally report positions that jump hundreds of meters between readings. The filter discards any point that implies movement above a configurable threshold (default 50 mph for trail use, adjustable up to ~93 mph for faster activities). This catches the worst outliers before they corrupt downstream processing.
Stop detection and averaging finds clusters of points within 5 meters of each other — places where you paused on the trail. Instead of keeping dozens of scattered readings at each stop, it averages them into a single high-confidence point. More samples at the same location means better accuracy, and this is where consumer GPS data actually has an advantage: all that redundant data at stops becomes useful.
Kalman smoothing reduces jitter on moving segments. The filter estimates the true position by weighing each GPS reading against a predicted position based on the previous trajectory. The strength is adjustable — higher values produce smoother tracks with less noise, lower values preserve more of the original detail.
CORS differential correction is the big accuracy gain. NOAA operates a network of Continuously Operating Reference Stations with precisely known positions. By comparing what a CORS station observed versus where it actually is, you get a correction vector that applies to nearby receivers. TrailFix downloads RINEX observation data directly from NOAA’s AWS mirror, parses it, and applies code-phase corrections scaled by your distance from the station.
CORS Accuracy by Distance
The correction quality degrades with baseline distance, but the results are solid within 50 km:
- < 20 km from station: ~0.3–0.7 m accuracy
- < 50 km: ~0.5–1.0 m
- < 100 km: ~0.7–1.2 m
The app ships with ~18 hardcoded CORS stations across WA/OR/ID/BC, sorted by distance from your track. Click download, drop the .gz file (auto-decompressed via pako), and apply.
Visualization
Three views for inspecting results:
- Canvas map — lightweight 2D rendering showing raw track (gray), smoothed track (green), removed spikes (orange), and CORS-corrected points (blue). Supports pan and zoom.
- Satellite map — full MapLibre GL or Mapbox GL integration. Free ESRI satellite tiles work out of the box, or paste a Mapbox token for their imagery.
- Points table — every point with coordinates, raw vs. improved position, and status flags.
Export
Processed tracks export to three formats, all named with the original filename plus a _trailfix suffix:
- KML for Google Earth
- GPX for other GPS software
- GeoJSON for GIS tools and web maps
Why a Single HTML File
The entire app is one 68 KB HTML file. No build step, no npm, no framework. You can download it, put it on a USB drive, and open it offline (the only network requests are optional: CORS data from NOAA and map tiles). External dependencies are just pako for gzip decompression and the map libraries, loaded from CDNs on demand.
This was a deliberate choice. GPS tools shouldn’t require an internet connection to function, and the people most likely to use this — outdoor hobbyists mapping trails — are the ones most likely to have intermittent connectivity.
What’s Next
The processing pipeline has room to grow:
- Multi-pass averaging — ride the same trail multiple times, average across all passes for even better accuracy
- Elevation profiles — visualize climb and descent along the track
- Speed and distance analytics — leverage GPX timestamps for pace, moving time, and segment breakdowns
- PWA support — service worker for true offline use with cached map tiles
The source is on GitHub and the live app is at adavenport.dev/trailfix.
Written by Alex Davenport
alexdavenport.dev