CINXE.COM
GPS Visualizer: Assign DEM elevation data to coordinates
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>GPS Visualizer: Assign DEM elevation data to coordinates</title> <script type="text/javascript"> MOBILE = false; </script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" /> <link rel="stylesheet" href="/gpsv.css" type="text/css" /> <script type="text/javascript" src="/gpsv.js"></script> <script type="text/javascript" src="/ads-page-ad.js?adunitid=ad"></script> <script src="https://the.gatekeeperconsent.com/cmp.min.js" data-cfasync="false"></script> <script async src="//www.ezojs.com/ezoic/sa.min.js"></script> <script> ezstandalone = window.ezstandalone || {}; ezstandalone.cmd = ezstandalone.cmd || []; ezstandalone.cmd.push(function(){ ezstandalone.enableConsent(); ezstandalone.define(103,104,105); ezstandalone.enable(); ezstandalone.display(); }); </script> <meta name="ezoic" content="block-npa" /> <script async src="https://www.googletagmanager.com/gtag/js?id=G-ME227XBLB8"></script> <script> /* Google Analytics */ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-ME227XBLB8'); </script> <link rel="shortcut icon" href="/favicon.png" /> <link rel="icon" sizes="144x144" href="/images/g-144x144.png" /> <meta name="theme-color" content="#0D4E0D" /> <link rel="image_src" href="https://www.gpsvisualizer.com/images/DEM_coverage_BEST.jpg" /> <meta property="og:image" content="https://www.gpsvisualizer.com/images/DEM_coverage_BEST.jpg" /> <meta name="description" content="GPS Visualizer's map, profile, and conversion programs have the ability to instantly add elevation data from a DEM (digital elevation model) database to any type of GPS file. Available DEM sources include NASADEM, NED/3DEP, SRTM3, and ASTER." /> </head> <body style="margin:0px;" onload="Enable_Return_Key('single_point_coords','single_point_button');"> <script type="text/javascript"> function LocalElevationLookup() { if (document.getElementById('single_point_coords') && document.getElementById('single_point_coords').value.match(/\w/)) { var coords = document.getElementById('single_point_coords').value.replace(/\t/,','); var request = new XMLHttpRequest(); var query_string = 'return_source=1&coords='+encodeURIComponent(coords); request.open('POST','elevation_data/elevation.json'); request.responseType = 'json'; request.onload = function() { LocalElevationCallback(request.response); } request.send(query_string); } else { return false; } } function LocalElevationCallback(data) { if (data && data[0] && document.getElementById('single_point_elevation')) { var meters = data[0][2]; var source = data[0][3]; if (meters != null) { var feet = null; if (meters == 0) { feet = 0; } else { feet = Math.round((meters)*3.28084); meters = Math.round((meters)*1); } document.getElementById('single_point_elevation').innerHTML = meters+' meters ('+feet+' feet) [data source: '+source+']'; } else { document.getElementById('single_point_elevation').innerHTML = 'no data found'; } } } </script> <div class="nonmobile_masthead" style="width:100%; background-color:#0d4e0d; padding:0px; color:#ffffff;"> <table cellspacing="0" cellpadding="0" border="0" style="background-color:#0d4e0d;"> <tr align="left" valign="middle"> <td style="padding-right:10px;"><a href="/"><img src="/images/gpsvisualizer_465x74.png" alt="GPS Visualizer" width="465" height="74" border="0" /></a></td> <td style="padding-right:15px;"> <table cellspacing="0" cellpadding="0" border="0"> <tr valign="top"> <td class="header_link" style="padding-left:9px; padding-right:6px;" nowrap> <p><a href="/map_input" style="text-transform:uppercase">Make a map</a></p> <p>- <a href="/map_input?form=leaflet">Leaflet</a>/<a href="/map_input?form=google">Google</a></p> <p>- <a href="/map_input?form=googleearth">Google Earth</a></p> <p>- <a href="/map_input?form=jpg">JPG</a>/<a href="/map_input?form=png">PNG</a>/<a href="/map_input?form=svg">SVG</a></p> </td> <td class="header_link" style="padding-left:9px; padding-right:6px;" nowrap> <p><a href="/profile_input" style="text-transform:uppercase">Make a profile</a></p> <p><a href="/convert_input" style="text-transform:uppercase">Convert a file</a></p> <p><a href="/draw/">Draw on a map</a></p> <p><a href="/calculators">Calculators</a></p> </td> <td class="header_link" style="padding-left:9px; padding-right:6px;" nowrap> <p><a href="/geocoding.html">Geocode addresses</a></p> <p><a href="/elevation">Look up elevations</a></p> <p><a href="/atlas.html">Atlas: Share a map</a></p> <p><a href="/gpsbabel/">GPSBabel</a></p> </td> <td class="header_link" style="padding-left:9px; padding-right:6px;" nowrap> <p><a href="/examples/">Examples</a></p> <p><a href="/tutorials/">Help/FAQ</a></p> <p><a href="/about.html">About GPSV</a></p> </td> </tr> </table> </td> <td valign="top" align="right" width="24" style="padding-top:8px;"> <a target="_blank" href="https://www.facebook.com/gpsvisualizer" class=""><img src="/images/facebook-48x48.svg" width="24" height="24" border="0" /></a> </td> </tr> </table> </div> <table cellspacing="0" cellpadding="0" border="0"><tr align="left" valign="top"> <td id="sidebar" style="height:100%; padding:8px;"> <div id="sidebar_strip" style="padding:0px; min-width:160px; transition:min-width 0.5s;"> <div id="ezoic-pub-ad-placeholder-103"> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0538542711751001" crossorigin="anonymous"></script> <!-- Ezoic 160x600 --> <ins class="adsbygoogle" style="display:inline-block;width:160px;height:600px" data-ad-client="ca-pub-0538542711751001" data-ad-slot="7977873699"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> </td> <td class="nonmobile_body" width="99%"> <div id="header_strip" style="padding:3px; height:90px; max-height:90px; xoverflow:hidden !important; transition:min-height 0.5s; text-align:center;"> <div id="ezoic-pub-ad-placeholder-104"> <table id="ez_donation_strip" style="display:none;"><tr><td height="50" valign="middle" nowrap><a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PN7SLQGN4BYNE&source=url"><img src="/images/paypal-130x50.png" border="0" align="absmiddle" style="margin-right:4px;" /></a> <b>No ads? No problem!</b> You can support GPS Visualizer by <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PN7SLQGN4BYNE&source=url">making a donation with PayPal</a> instead.</td></tr></table> <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-0538542711751001" crossorigin="anonymous"></script> <!-- Ezoic header (728x90) --> <ins class="adsbygoogle" style="display:inline-block;width:728px;height:90px" data-ad-client="ca-pub-0538542711751001" data-ad-slot="6664792025"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> <script type="text/javascript"> function ShrinkHeaderAndSidebar() { if (document.getElementById('sidebar_strip')) { //document.getElementById('sidebar_strip').style.minWidth = '80px'; } if (document.getElementById('header_strip')) { document.getElementById('header_strip').style.height = 'none'; document.getElementById('header_strip').style.minHeight = '0px'; } } function CheckForWaldo() { if (!document.getElementById('waldo_donation_strip')) { return false; } var blocked = false; var parent = document.getElementById('waldo_donation_strip').parentNode; var grandparent = (parent && parent.parentNode) ? parent.parentNode : null; if(!document.getElementById('waldo_donation_strip')) { // it's been eliminated blocked = false; } else if (parent && parent.childElementCount == 1) { // nothing was inserted next to the donation message blocked = true; } if (blocked) { ShrinkHeaderAndSidebar(); if (document.getElementById('waldo_donation_strip')) { document.getElementById('waldo_donation_strip').style.display = 'inline-block'; } } } function DonationBanner() { AdBlockerDetected = (self.NoAdBlocker) ? false : true; if (AdBlockerDetected){ // ad blocker IS in use if (document.getElementById('header_strip')) { var msg = '<table id="donation_strip" cellspacing="0" cellpadding="0" border="0" style="height:100%"><tr><td height="50" valign="middle"><a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PN7SLQGN4BYNE&source=url"><img src="/images/paypal-130x50.png" border="0" align="absmiddle" style="margin-right:4px;"><'+'/a><'+'/td><'+'td><b>No ads? No problem.<'+'/b> You can support GPS Visualizer by <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PN7SLQGN4BYNE&source=url">making a donation with PayPal<'+'/a> instead.<'+'/td><'+'/tr><'+'/table>'; document.getElementById('header_strip').innerHTML = msg; } // ShrinkHeaderAndSidebar(); } // the following line puts in the donation message even if an ad-blocker wasn't detected, by detecting that the "waldo" tag was NOT replaced with an ad. window.setTimeout("CheckForWaldo()",5000); } window.setTimeout('DonationBanner()',2000); </script> </div> <br /> <div class="multi_column centered_boxes"><div style="margin-right:12px; text-align:left;"> <h1 style="margin-top:0px;">Find "Missing" Elevations with GPS Visualizer</h1> <p style="margin-bottom:0px;"><b>The problem:</b> Sometimes you have geographic data that consists only of latitudes and longitudes, but you want to know the altitudes as well — because, for example, you want to colorize points by height above sea level, or <a href="/profile_input?add_elevation=auto">draw a profile</a> of a track. Here are some common reasons why you might have "flat" or incomplete data:</p> <ul style="margin-top:0px; padding-top:0px;"> <li style="margin-top:4px;">Your GPS device does not log altitude, or you had poor satellite reception when you recorded the track.</li> <li style="margin-top:4px;">Your GPS device <em>does</em> log altitude, but it's not very accurate.</li> <li style="margin-top:4px;">You drew a track using the drawing tools in Google Earth or a similar application, like GPS Visualizer's <a href="/draw/">Sandbox</a>.</li> <li style="margin-top:4px;">You have a KML file that came from Google Maps or Google Earth's "driving directions" feature.</li> <li style="margin-top:4px;">You created a route in Google Maps and have the URL of that route.</li> <li style="margin-top:4px;">You have an NMEA log file that contains only "GPRMC" sentences, not "GPGGA."</li> </ul> </div><div style="background:pink;"> <div style="display:inline-block; vertical-align:top; margin:0px auto 0px auto; min-width:147px; max-width:190px; padding:6px; text-align:center; background-color:#006600; border-radius:8px; color:#FFFFFF;"> <a target="_blank" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=PN7SLQGN4BYNE&source=url"><img src="/images/paypal-130x50.png" border="0" alt="[Donate via PayPal]"></a> <p style="margin:5px 0px 5px 0px; text-align:center;" class="smaller"><b>Support GPS Visualizer</b></p> <p style="text-align:left;" class="smaller">If you find the utilities on GPSVisualizer.com interesting, time-saving, or just plain fun, you can say "thanks" — and encourage further development — by clicking the button above and making a contribution <nobr>via PayPal.</nobr></p> </div> </div></div> <h3 style="clear:both; margin-top:24px;">Solution #1: DEM database</h3> <p style="margin-top:16px;">GPS Visualizer's <a href="/map_input?form=googleearth&add_elevation=auto">map</a>, <a href="/profile_input?add_elevation=auto">profile</a>, and <a href="/convert_input?add_elevation=auto">conversion</a> programs have the ability to instantly add elevation data — from a DEM (digital elevation model) database — to any type of GPS file. If you just want to draw a profile, or convert a single data file to plain text or GPX while adding elevation, you can use the simple form right here:</p> <form method="POST" enctype="multipart/form-data" action="/convert?output_elevation" name="convert_form" style="margin:0px; padding:0px;"> <div style="padding:0px; margin:12px 12px 20px 12px; border:2px solid #006600; background-color:#e7ffee; text-align:center;"> <div style="display:inline-block; vertical-align:middle; white-space:nowrap; line-height:22px; text-align:left; padding:5px;"> Upload a file: <input type="file" name="uploaded_file_1" size="12"><br> Or provide a URL: <input type="text" name="remote_data" size="18"> </div> <div style="display:inline-block; vertical-align:middle; line-height:22px; text-align:center; padding:5px;"> <div style="display:inline-block; vertical-align:middle; padding:5px;"> <input type="submit" name="submitted" value="Convert & add elevation" style="font-weight:bold;" onclick="document.convert_form.action='/convert?output_elevation';"> <br>Output: <select class="normal" name="convert_format" size="1"><option value="gpx">GPX file</option><option value="text">Plain text</option></select> </div> <div style="display:inline-block; vertical-align:middle;">-or-</div> <div style="display:inline-block; vertical-align:middle; padding:5px;"> <input type="submit" name="submitted" value="Draw elevation profile" style="font-weight:bold;" onclick="document.convert_form.action='/profile?output_elevation';"> <br>Units: <select class="normal" name="units" size="1"><option value="metric">Metric</option><option value="us">U.S.</option></select> </div> </div> </div> <input type="hidden" name="convert_delimiter" value="tab"> <input type="hidden" name="add_elevation" value="auto"> <input type="hidden" name="profile_x" value="distance"> <input type="hidden" name="profile_y" value="altitude"> <!-- <input type="hidden" name="profile_y_min" value="0.000001"> --> </form> <div style="float:right; margin:0px 0px 8px 12px; text-align:center; font-style:italic; font-size:8pt; background-color:#cceecc; width:50%; max-width:320px;"> <a target="_blank" href="/DEM_coverage.php"><img src="/images/DEM_coverage_BEST.jpg" style="width:100%;" /></a><br> <a target="_blank" href="/DEM_coverage.php" style="text-decoration:none;">(Click for more DEM coverage maps)</a> </div> <p>Or, look in GPS Visualizer's various input forms for the menu called "Add DEM elevation data," and choose one of the elevation databases (described in the table below). Complete copies of the NASADEM/SRTM1, SRTM3, and USGS NED1/3DEP databases, as well as hundreds of enhanced 1-arc-second files from Europe, are stored on GPS Visualizer's server — that's more than 500GB of raw data.</p> <p>Note that the elevation-adding feature will <em>erase</em> any existing altitude data (for example, from a GPS) that might already be in your file. Often, this is desirable; profiles made with DEM data are usually "smoother" looking than GPS, and typically contain fewer gaps or suspicious readings. (Speaking of gaps, there are a few in NASA's SRTM data, and that's unavoidable. If GPS Visualizer runs into one of these, it will <em>not</em> overwrite those elevations in your input data.)</p> <h4 style="clear:both;">DEM data sources</h4> <table cellspacing="0" cellpadding="0" border="0"> <tr valign="top" align="left" style=""> <td style="border-top:1px solid #006600; padding:4px 8px 4px 0px;"><b>NED/3DEP</b> (USGS)</td> <td style="border-top:1px solid #006600; padding:4px 0px 4px 0px;">The U.S. Geological Survey's excellent National Elevation Dataset — now rebranded as <a target="_blank" href="https://www.usgs.gov/3d-elevation-program">3DEP</a> — covers the <b>United States, Canada, and Mexico</b>. 1 arc-second (~30-meter) horizontal resolution is available in most areas (NED1). For Alaska, 60-meter data is also available (NED2). USGS also produces 1/3-arc-second data (NED13), but because those files are 9 times larger than NED1 files, only a few mountainous areas (Cascade Range, Sierra Nevada, southern Utah, etc.) are available on GPS Visualizer.</td> </tr> <tr valign="top" align="left"> <td style="border-top:1px solid #006600; padding:4px 8px 4px 0px;"><b>NASA1</b></td> <td style="border-top:1px solid #006600; padding:4px 0px 4px 0px;">NASA's SRTM1 data (from the <a target="_blank" href="https://www2.jpl.nasa.gov/srtm/">Space Shuttle Radar Topography Mission</a>) has a resolution of 1 arc-second (about 30 meters) and covers <b>the entire world between 60°S and 60°N</b>. Recently, they've re-processed and enhanced the SRTM1 data — using ASTER, NED, and GLAS, among other sources — to produce the "<a target="_blank" href="https://lpdaac.usgs.gov/products/nasadem_sspv001/">NASA DEM</a>," which has replaced SRTM1 in GPS Visualizer.</td> </tr> <tr valign="top" align="left"> <td style="border-top:1px solid #006600; padding:4px 8px 4px 0px;"><b>ODP1</b></td> <td style="border-top:1px solid #006600; padding:4px 0px 4px 0px;">Digital 1-arcsecond terrain models of European countries, compiled and resampled by <a target="_blank" href="https://sonny.4lima.de/">Sonny</a>; formerly hosted by Austria's OpenDataPortal (hence the "ODP" code) and currently available at <a target="_blank" href="https://sonny.4lima.de/">https://sonny.4lima.de/</a>. These are high-quality digital elevation files from <b>Western Europe</b> and <b>Iceland</b> which have been copied to GPS Visualizer's server. Most of the files are a combination of SRTM1 and local LIDAR and/or survey data, and they have a horizontal resolution of 1 arc-second (about 30 meters north-south and 20 meters east-west). In most locations, they are more accurate than SRTM1 files.</td> </tr> <tr valign="top" align="left"> <td style="border-top:1px solid #006600; padding:4px 8px 4px 0px;"><b>ASTER</b></td> <td style="border-top:1px solid #006600; padding:4px 0px 4px 0px;">The <a target="_blank" href="https://asterweb.jpl.nasa.gov/gdem.asp">ASTER GDEM</a> is a joint product of NASA and the Japanese Ministry of Economy, Trade, and Industry (METI). ASTER has good 30-meter coverage of the entire world, but the massive size of the database makes it impractical to store all of it on GPSVisualizer.com. (As with SRTM1 data, additional files can be added upon request.)</td> </tr> <tr valign="top" align="left"> <td style="border-top:1px solid #006600; padding:4px 8px 4px 0px;"><b>SRTM3</b> (NASA)</td> <td style="border-top:1px solid #006600; padding:4px 0px 4px 0px;">NASA's <a target="_blank" href="https://lpdaac.usgs.gov/products/srtmgl3v003/">SRTM3 v3 dataset</a> includes 90-meter resolution for <b>the entire world</b>. SRTM3 data normally only goes up to about 60° latitude, but thanks to the efforts of the volunteers at <a target="_blank" href="http://www.viewfinderpanoramas.org/">Viewfinder Panoramas</a>, GPS Visualizer has the polar regions covered as well.</td> </tr> <tr valign="top" align="left" style=""> <td style="border-top:1px solid #006600; border-bottom:1px solid #006600; padding:4px 8px 4px 0px;"><b>"Best available"</b></td> <td style="border-top:1px solid #006600; border-bottom:1px solid #006600; padding:4px 0px 4px 0px;">GPS Visualizer will automatically select the best DEM data available in a given location. The quality ranking is as follows: NED13, NED1, ODP1, SRTM1, ASTER, NED2, ODP3, SRTM3. <a href="/DEM_coverage.php">Click here for a map</a>.</td> </tr> </table> <p style="margin-top:1em; color:#cc0000;">WARNING: If you set up an automated process to "scrape" GPS Visualizer's elevation data, your access will be blocked. If you need bulk data, you should download the DEM files directly from the data providers (e.g., <a target="_blank" href="https://www.usgs.gov/3d-elevation-program" style="color:#ff0000;">USGS</a> or <a target="_blank" href="https://lpdaac.usgs.gov/products/nasadem_sspv001/" style="color:#ff0000;">NASA</a>).</p> <br> <h3>Solution #2: Google Maps API</h3> <p>The Google Maps API is able to return elevations for points anywhere in the world; these are often (but not always) the same elevations you'd see in Google Earth. Google's data comes from a variety of sources and is sometimes more accurate than the SRTM databases.</p> <p>The drawback is that there is a limit on the number of queries that can be performed in a day by each user, so GPS Visualizer cannot ask Google for all of your points. To get around this, GPS Visualizer hosts a JavaScript-based <a href="/geocoder/elevation.html"><b>Elevation Lookup Utility</b></a> that has <em>your</em> browser perform the queries. To use this tool, your data must be in simple tabular format (easily accomplished using GPSV's <a href="/convert_input">plain-text converter</a>); you must remove any existing elevation data; and you must have your own Google Maps API Key. Further instructions are on the <a href="/geocoder/elevation.html">Elevation Lookup Utility page</a>.</p> <br /> <hr /> <h4>Quick single-point DEM database lookup:</h4> Coordinates (lat,lon): <input type="text" id="single_point_coords" size="20"> <input id="single_point_button" type="button" onclick="document.getElementById('single_point_elevation').innerHTML=''; LocalElevationLookup('single_point_coords')" value="FIND ELEVATION" /> <span style="font-size:14px; font-family:sans-serif;">→</span> <span id="single_point_elevation"></span><br> <br> <br> <br> <div id="footer" style="width:100%;"> <table width="100%" cellspacing="0" cellpadding="0" border="0" style="border-top:1px solid #006600; padding-top:3px;"><tr valign="top"><td class="footer" align="left"> ©2003-2019 <a href="http://adamschneider.net/">Adam Schneider</a>, <img src="/images/email.svg" align="absmiddle" alt="adam [at] gpsvisualizer [dot] com" style="height:1.2em;" />. </td><td class="footer" align="right"> <a href="/privacy.html">Privacy Policy</a> </td></tr></table> </div> </td> </tr></table> </body> </html>