{dataset}: Get elevation for locations

API: opentopodata.org:open-topo-data
Endpoint: /v1/{dataset}
Response format: application/json
Auth: unknown
Method: GET

Description

Reads elevation data from a specified dataset for one or more latitude/longitude locations. Supports multiple locations in a single request.

Parameters (6)

dataset (string, path, required)

Name of the elevation dataset to query

Constraints: {'enum': ['aster30m', 'bkg200m', 'emod2018', 'etopo1', 'eudem25m', 'gebco2020', 'mapzen', 'ned10m', 'nzdem8m', 'srtm30m', 'srtm90m', 'test-dataset']}

format (string, query, optional, default: json)

Response format

Constraints: {'enum': ['json', 'geojson']}

interpolation (string, query, optional, default: bilinear)

Interpolation algorithm for resampling elevation data

Constraints: {'enum': ['nearest', 'bilinear', 'cubic']}

locations (string, query, required)

Latitude,longitude pairs delimited by '|' (pipe), or a Google polyline encoding. Example: '37.7749,-122.4194|48.8566,2.3522'

nodata_value (string, query, optional, default: null)

Value to return for NODATA pixels (areas with no elevation data like oceans in some datasets). 'null' returns JSON null, 'nan' returns NaN, or specify an integer.

samples (integer, query, optional)

Number of equally-spaced samples to interpolate along the path. When provided, returns elevation for points along a path between the specified locations.

Constraints: {'minimum': 1}

Examples (1)

Get elevation for locations openapi-spec
curl 'https://api.opentopodata.org/v1/{dataset}'
import requests

resp = requests.get("https://api.opentopodata.org/v1/{dataset}")
data = resp.json()
import zingu_apis

api = zingu_apis.api("opentopodata")
result = api.fetch("v1/{dataset}")

for item in result:
    print(item)
const resp = await fetch("https://api.opentopodata.org/v1/{dataset}");
const data = await resp.json();

No probe data for this endpoint yet.