Fix the elevation in a GPX file

GPS altitude is the weakest part of any recorded track. Replace it with ground elevations from the USGS 3DEP lidar model, and keep everything else in the file as it was.

Correct a track now

Upload a GPX file recorded in Oregon and get it back with lidar ground elevations. Elevate a File needs a pass, asked for before the upload: US$29 for 24 hours, US$99 for 30 days or US$399 for 12 months.

Open Elevate a File →

Why is my GPX elevation wrong?

If your track’s profile looks jagged, or your watch claims far more climb than the trail had, the altitude is the culprit. A GPS receiver fixes its position from satellites that are all above it, so the vertical part of the fix is weaker than the horizontal part.

  • Satellite geometry: with every satellite overhead, height is the hardest thing to pin down.
  • Reflections: canyon walls, buildings and heavy tree cover bounce the signals, giving sudden spikes and drops.
  • The device: watches and phones use small antennas and simple processing.
  • Start-up: the first minutes after a device finds satellites are often the least accurate.

The result is an altitude that wanders around the true value. Every wobble counts as climb or descent, so totals grow and grades look wild.

GPS altitude and barometric altitude

GPS altitude

Calculated from the satellite fix. Noisy from point to point, but it does not drift over time.

Barometric altitude

Many watches and bike computers measure air pressure, which falls as you climb. That tracks small changes well, but air pressure also changes with the weather, so the reading drifts over a long day. Out-and-back trips that start and end at the same spot often finish at a different recorded elevation.

Neither is ground truth

Devices that blend the two do better, but the only way to get the elevation of the ground is to read it from an elevation model made from accurate source data such as lidar.

How the correction works

  1. Read the file: every track point, route point and waypoint is read with its latitude and longitude.
  2. Load the terrain: the USGS 3DEP model is read as a grid over the area the points cover, at most 1,024 samples across its longest side. A track that covers a small area is read at the full detail of the source; a longer one, coarser.
  3. Sample each point: the elevation at each point is interpolated between the four nearest cells of that grid, so it is not locked to a cell.
  4. Write it back: the value goes into the point’s <ele> element, replacing what the device recorded, or a new <ele> is added where there was none.
  5. Return the file: the same GPX comes back as yourfile_elevation.gpx, with only the elevations changed.

This is different from smoothing. Smoothing makes a noisy profile look calmer but does not make it more accurate; reading the ground from the model replaces the noisy values with measured terrain.

Correct your GPX elevation

Replace GPS altitude with lidar ground elevations in seconds.

Why lidar beats GPS altitude

  • Consumer GPS altitude: affected by satellite geometry, reflections and the device; changes from one second to the next.
  • Global elevation models: many correction services worldwide use them. They are coarse, and some measure the top of the forest canopy rather than the ground.
  • USGS 3DEP lidar: a bare-earth model at 3.3 ft per pixel wherever lidar has been flown. Lidar pulses reach the ground between the trees, so forest trails get the elevation of the ground you walked on.

How to correct a GPX file

  1. Export the track: download the activity as GPX from your watch, Strava, Garmin Connect or the app you recorded with.
  2. Open the tool: open Elevate a File. It needs a pass (US$29 for 24 hours, US$99 for 30 days or US$399 for 12 months; see pricing) and asks for one before the upload. Then choose the file. It can be up to 50 MB, and all its points must fit in a square 3.7 miles on a side.
  3. Run it: the file is sent to the server, every point is sampled, and the corrected file is sent straight back. Nothing is stored.
  4. Download: save the corrected file, which keeps the original name with _elevation added.
  5. Import: load the new file into your training app, mapping app or GPS device.

Before and after: what changes

Total climb usually drops

With the jitter gone, the false rises and falls disappear, and the total climb usually comes down. How much depends on the device and the terrain.

A smoother profile

The spiky line becomes the shape of the ground: clean climbs and descents, and flats that actually look flat.

Realistic grades

Grades that flipped between steep up and steep down from one point to the next settle to the grade of the ground.

Correct high and low points

The highest and lowest points on the route are now ground elevations above NAVD 88, not the device’s estimate.

Tracks that benefit most

  • Under forest canopy: the dense conifer forests of western Oregon, from Forest Park in Portland to the Coast Range, are hard on GPS reception.
  • In canyons and gorges: steep walls such as those of the Columbia Gorge hide satellites and reflect signals.
  • Downtown: tall buildings reflect GPS signals, adding phantom hills to flat streets.
  • Long days with a barometer: a day on the Timberline Trail around Mount Hood is long enough for the weather, and the barometer, to change.
  • Phone recordings: phones are often noisier than dedicated GPS devices.

Corrected files and training apps

Why apps differ

Training apps handle elevation in different ways: some keep the elevation in the file, some replace it with their own elevation data, some depend on whether the device has a barometer. Check your app’s help pages for how it treats elevation in an uploaded file.

Uploading the corrected file

Most apps let you upload a GPX file as a new activity. To avoid a duplicate, delete or hide the original recording first, following your app’s own instructions.

Why it matters for training

Everything that depends on elevation, from total climb to grade-adjusted pace and estimates of effort, is only as good as the elevation in the file.

Data source and accuracy

Ground elevations on this site come from the USGS 3D Elevation Program (3DEP) seamless bare-earth model: 3.3 ft per pixel where lidar has been flown and about 33 ft per pixel elsewhere, with elevations above NAVD 88. The data is in the public domain. Most of Oregon’s lidar was flown through the Oregon Lidar Consortium, run by DOGAMI, the Oregon Department of Geology and Mineral Industries. DOGAMI reports about 99% of Oregon covered by at least one lidar project. Values in the file are in meters with one decimal, because the GPX format defines <ele> that way; your app converts them to feet for display. Bridges and boardwalks are not in the model, so a point on a bridge gets the ground or water below it. More from the USGS 3D Elevation Program and DOGAMI’s lidar program.

Frequently asked questions

Will correcting elevation change my route or timestamps?

No. Only the elevation of each point changes. Latitude, longitude, times, names and any extension data such as heart rate, cadence or power stay as they were in your file.

Why did my watch show more climb than the corrected file?

GPS altitude jumps up and down from one point to the next, and a barometric altimeter drifts as the weather changes. Every false rise is added to the total climb. Ground elevations from the lidar model do not jitter, so the corrected file usually shows less total climb.

Does it work everywhere in Oregon?

Yes. Ground elevations on this site come from the USGS 3D Elevation Program (3DEP) seamless bare-earth model: 3.3 ft per pixel where lidar has been flown and about 33 ft per pixel elsewhere, with elevations above NAVD 88. The data is in the public domain. Most of Oregon’s lidar was flown through the Oregon Lidar Consortium, run by DOGAMI, the Oregon Department of Geology and Mineral Industries. DOGAMI reports about 99% of Oregon covered by at least one lidar project.

Can I correct a track recorded outside Oregon?

No. Oregon Elevation Tools covers Oregon only. Points outside the state get no elevation from this tool.

Is the corrected elevation better than what my training app shows?

Apps use a range of elevation sources and corrections, and they do not all say which. Inside Oregon this tool samples the USGS 3DEP bare-earth model, which is 3.3 ft per pixel wherever lidar exists. The sampling grid covers the area of your track at up to 1,024 samples across its longest side, so a short track is read at the full detail of the source and a track that spreads over several miles at a coarser spacing.

How large a GPX file can I correct?

Up to 50 MB, with every point inside a square 3.7 miles on a side. Split a longer track into parts and correct each one.

Related guides