NED

The National Elevation Dataset (NED) is a collection of DEMs covering the USA at different resolutions.

Resolution and Coverage

NED comes in several different resolutions, each with a different coverage area.

The most commonly used resolutions are 1 arcsecond (covering North America and Mexico) and 1/3 arcsecond (covering CONUS, HI, PR, and parts of AK). The 1/3 arcsecond dataset is used in the Open Topo Data public API.

NED 1 arcsecond coverage. 1 arcsecond (30m).
NED 1/3 arcsecond coverage. 1/3 arcsecond (10m).

Two higher resolutions have partial coverage focused on more urbanised areas.

NED 1/9 arcsecond coverage. 1/9 arcsecond (3m).
NED 1 meter coverage. 1m.

And there are separate datasets with full coverage of Alaska at 2 arseconds (60m) and 5m.

NED 2 arcsecond coverage. 2 arcsecond (60).
NED 5 meter coverage. 5m.

Coverage screenshots are from The National Map.

Adding NED 10m to Open Topo Data

Make a new folder for the dataset:

mkdir ./data/ned10m

Download the files from USGS into ./data/ned10m. You want the USGS_13_xxxxxxx.tif files.

Next, Open Topo Data needs the filenames to match the SRTM format: the filename should be the coordinates of the lower-left corner. Here's the Python code I used to do the conversion.

from glob import glob
import os
import re

old_pattern = './data/ned10m/USGS_13_*.tif'
old_paths = list(glob(old_pattern))
print('Found {} files'.format(len(old_paths)))

for old_path in old_paths:
    folder = os.path.dirname(old_path)
    old_filename = os.path.basename(old_path)

    # Extract northing.
    res = re.search(r'([ns]\d\d)', old_filename)
    old_northing = res.groups()[0]

    # Fix the NS 
    n_or_s = old_northing[0]
    ns_value = int(old_northing[1:3])
    if old_northing[:3] == 'n00':
        new_northing = 's01' + old_northing[3:]
    elif n_or_s == 'n':
        new_northing = 'n' + str(ns_value - 1).zfill(2) + old_northing[3:]
    elif n_or_s == 's':
        new_northing = 's' + str(ns_value + 1).zfill(2) + old_northing[3:]
    new_filename = old_filename.replace(old_northing, new_northing)
    assert new_northing in new_filename

    # Prevent new filename from overwriting old tiles.
    parts = new_filename.split('.')
    parts[0] = parts[0] + '_renamed'
    new_filename = '.'.join(parts)

    # Rename in place.
    new_path = os.path.join(folder, new_filename)
    os.rename(old_path, new_path)

Create a config.yaml file:

datasets:
- name: ned10m
  path: data/ned10m/
  filename_epsg: 4269

Rebuild to enable the new dataset at localhost:5000/v1/ned10m.

make build && make run

Public API

The Open Topo Data public API lets you query NED 10m for free:

curl https://api.opentopodata.org/v1/ned10m?locations=37.6535,-119.4105
{
  "results": [
    {
      "elevation": 3498.298583984375, 
      "location": {
        "lat": 37.6535, 
        "lng": -119.4105
      }
    }
  ], 
  "status": "OK"
}

NED is still being updated by USGS. The dataset used by the public API was last updated 2020-04-23.