Add elevation to KML files
Write the ground elevation, read from the USGS 3DEP lidar model, into every coordinate of a KML file: placemarks, paths and polygons anywhere in Oregon.
Add elevation to a KML file
Elevate a File needs a pass: US$29 for 24 hours, US$99 for 30 days or US$399 for 12 months. It asks for one before the upload, then sends the file back with ground elevations.
Open Elevate a File →Why add elevation to a KML file?
KML coordinates can carry an altitude as a third value, but many files have only longitude and latitude: paths drawn in Google Earth or Google My Maps, points exported from a spreadsheet, boundaries converted from GIS. With ground elevations in the file you can:
- work out the elevation of each placemark without looking it up by hand;
- draw a profile of a path in software that reads KML altitudes;
- carry real elevations into GIS when the file is converted;
- place features at their true height in a 3D view.
Using it with Google Earth
In KML, how a viewer uses the altitude depends on <altitudeMode>. The default is clampToGround, which ignores the altitude and drapes the feature on the terrain. Elevate a File writes the values but does not change the altitude mode, so a file that had none still draws on the ground in Google Earth, while the elevations are there for any software that reads them. To have Google Earth place a feature at the written heights, set its <altitudeMode> to absolute, as the KML reference describes.
<LineString>
<altitudeMode>absolute</altitudeMode>
<coordinates>
-122.7559,45.5401,295
-122.7565,45.5412,292.6
-122.7571,45.5420,298.8
</coordinates>
</LineString>The values above are ground elevations for three points in Portland’s West Hills, above NAVD 88; values in the file are in meters, the unit KML uses.
Process your KML file
Ground elevations from USGS 3DEP lidar on every coordinate, in seconds.
How it works
- Upload: open Elevate a File and, with a pass active, choose the
.kmlfile (up to 50 MB, all coordinates inside a square 3.7 miles on a side). - Processing: every
<coordinates>element is read, and each longitude, latitude pair is sampled from the 3DEP model. The elevation is written as the third value, replacing any altitude that was there. - Download: the file comes back as
yourfile_elevation.kml.
What gets elevation
- Points: placemarks get one elevation each.
- LineStrings: every vertex of a path or track.
- Polygons: every vertex of the outer and inner rings.
- MultiGeometry: each part is handled like the geometries above.
Names, descriptions, styles and folders are left as they were. The coordinate lists are rewritten one coordinate per line. KML files that come zipped as .kmz need to be unzipped to .kml first.
Use cases
Trail mapping
Add elevations to a trail drawn in Google Earth, for example a route up the Columbia Gorge or through Forest Park, before converting it for a GPS unit.
Property and land
Give corner points or a boundary sketch ground elevations. Taxlot lines are assessment maps, not surveys; for legal boundaries and elevations, use a licensed land surveyor.
Conservation and field work
Add elevations to plot locations, photo points or restoration sites recorded as placemarks.
Teaching and tourism
Build Google Earth tours of the Cascade volcanoes or the Oregon coast with features placed at their ground elevation.
Data quality
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 (as USGS publishes them), with one decimal. The file’s points are read from a grid of the model laid over the area they cover, at most 1,024 samples across its longest side: for a file that covers a small area the grid is as fine as the source, and for a file that spreads toward the 3.7 miles limit it is coarser. Each point is interpolated between the four nearest cells of that grid. KML altitude is defined in meters, so the values go in as published. Points outside Oregon, or where no elevation can be read, keep only their longitude and latitude. More from the USGS 3D Elevation Program and DOGAMI’s lidar program.
Converting other formats to KML
You do not need to convert first: the same tool takes GPX, GeoJSON and CSV directly. See GPX, GeoJSON and CSV.
Tips for best results
- Coordinates must be longitude, latitude in decimal degrees (WGS84), as KML requires.
- Split very large files so each part fits in a square 3.7 miles on a side.
- Set
altitudeModetoabsoluteif you want Google Earth to use the heights. - Remember the values are bare ground, not the tops of buildings or trees.