EarthplatformoperationId elevation
GET/v1/elevation
Elevation at a point, or sampled evenly along a path.
Send Authorization: Bearer sk_live_…. The key's plan must include theplatform product; which plans do.
Explained in Elevation and rasters and Enriching a coordinate.
Example
Elevation at a point.
curl -G "https://api.oslew.com/v1/elevation" \
-H "Authorization: Bearer $GEO_API_KEY" \
--data-urlencode 'at=19.4326,-99.1332'from oslew import Client
# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")
answer = client.elevation(at="19.4326,-99.1332")import { Client } from "@oslew/client";
// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });
const answer = await client.elevation({ at: "19.4326,-99.1332" });HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 299
ratelimit-reset: 1
{
"results": [
{
"lat": 19.4326,
"lon": -99.1332,
"elevation_m": 2228.8455999999974,
"resolution_m": 30
}
],
"provenance": {
"name": "copernicus-dem-glo-30",
"release": "2022-05",
"license": "Copernicus DEM licence (attribution: © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA)"
},
"took_us": 3
}A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.
Query
| Name | Type | Description |
|---|---|---|
atquery | string | lat,lon; one of at or path. |
pathquery | string | lat,lon;lat,lon;… |
samplesquery | integer ≥ 2, ≤ 512 default 32 |
Responses
200 — Metres per point, bilinear on a 30 m grid; null outside coverage.
provenanceSource | nullrequiredlicensestringrequirednamestringrequiredreleasestringrequired
resultsobject[]requiredelevation_mnumber | nullrequiredlatnumberrequiredlonnumberrequiredresolution_mnumber | nullrequired
took_usintegerrequired
With RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset(and their X-RateLimit-* aliases); see rate limits.
Refusals
Every refusal is a JSON object with an error string, except where noted.
| 400 | Bad request. |
| 401 | No key, or one that is unknown, revoked or suspended. |
| 403 | The key's plan does not include this route's product, or the request is larger than the plan allows. The body names the plan that does. |
| 429 | This product's bucket is empty: the key is going faster than its plan's sustained rate. Wait Retry-After seconds; nothing is used up. Carries Retry-After. |
| 503 | The pod cannot reach the control plane and its entitlements are too old to trust. Retry. |
A malformed query string or JSON body is refused by the framework before this route runs, in plain text rather than JSON; see errors.
More examples
A profile along a path
curl -G "https://api.oslew.com/v1/elevation" \
-H "Authorization: Bearer $GEO_API_KEY" \
--data-urlencode 'path=19.4326,-99.1332;19.2086,-99.2586' \
--data-urlencode 'samples=8'from oslew import Client
# The key is read from GEO_API_KEY.
client = Client(base_url="https://api.oslew.com")
answer = client.elevation(path="19.4326,-99.1332;19.2086,-99.2586", samples=8)import { Client } from "@oslew/client";
// The key is read from GEO_API_KEY.
const client = new Client({ baseUrl: "https://api.oslew.com" });
const answer = await client.elevation({ path: "19.4326,-99.1332;19.2086,-99.2586", samples: 8 });HTTP/1.1 200 OK
content-type: application/json
ratelimit-limit: 100
ratelimit-remaining: 298
ratelimit-reset: 1
{
"results": [
{
"lat": 19.4326,
"lon": -99.1332,
"elevation_m": 2228.8455999999974,
"resolution_m": 30
},
{
"lat": 19.4006,
"lon": -99.15111428571429,
"elevation_m": 2234.058342857149,
"resolution_m": 30
},
{
"lat": 19.3686,
"lon": -99.16902857142857,
"elevation_m": 2251.4623999999963,
"resolution_m": 30
},
{
"lat": 19.3366,
"lon": -99.18694285714285,
"elevation_m": 2280.097314285677,
"resolution_m": 30
},
{
"lat": 19.3046,
"lon": -99.20485714285715,
"elevation_m": 2369.012571428547,
"resolution_m": 30
},
{
"lat": 19.2726,
"lon": -99.22277142857143,
"elevation_m": 2661.419999999993,
"resolution_m": 30
},
{
"lat": 19.2406,
"lon": -99.24068571428572,
"elevation_m": 2940.979257142865,
"resolution_m": 30
},
{
"lat": 19.2086,
"lon": -99.2586,
"elevation_m": 3863.2535999999523,
"resolution_m": 30
}
],
"provenance": {
"name": "copernicus-dem-glo-30",
"release": "2022-05",
"license": "Copernicus DEM licence (attribution: © DLR e.V. 2010-2014 and © Airbus Defence and Space GmbH 2014-2018 provided under COPERNICUS by the European Union and ESA)"
},
"took_us": 1205
}A real response, captured from the service at commit b8f4bde-dirty. Timing fields such as took_us differ on every call.
Rendered from the OpenAPI document at commit b8f4bde-dirty; the same document is served at/v1/openapi.json and generates both clients.