Get Route Elevation Profile
elevation_get_profileSample terrain elevation at evenly spaced points along a route (a polyline of 2–1,000 vertices) and summarize it. Returns total distance, cumulative ascent and descent, start, end, minimum, and maximum elevation, and the steepest climb and descent grades, plus the per-sample profile with each sample's dataset unless include_samples is false. Ascent and descent are summed between samples, so they depend on the sample spacing reported in the result: denser sampling captures more small climbs, down to the source's resolution. Over open water, Mapzen samples are sea-floor depths. Each USGS 3DEP sample is a separate upstream request, so up to 250 samples take roughly 10–30 seconds.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Route vertices in travel order, 2–1,000 {lat, lon} objects in decimal degrees (WGS84). Consecutive duplicate vertices are ignored. | |
| source | No | Elevation source: auto (default) uses USGS 3DEP where it has data and Open Topo Data (SRTM, with Mapzen terrain tiles where SRTM has no data) for the rest; usgs_3dep uses 3DEP only; opentopodata uses Open Topo Data only. Case is ignored and spaces or hyphens read as underscores, so USGS-3DEP and open topo data are accepted; 3dep, usgs, and epqs are also aliases for usgs_3dep. | auto |
| samples | No | Number of evenly spaced samples along the route, endpoints included (2–250, default 100). More samples catch more relief and take longer; spacing finer than the source resolution adds no detail. For a large count where only the summary matters, set include_samples to false. | |
| include_samples | No | Return the per-sample profile (default true). false omits samples and the sample table; the summary, spacing, coverage counts, datasets, notices, and attribution are unchanged, still computed from every sample. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| notice | No | Guidance on samples without data, routes crossing the USGS 3DEP coverage edge, Mapzen sea-floor values, and sample spacing against the source resolution. | |
| samples | No | Every sample in route order, endpoints included. Absent when include_samples is false. | |
| summary | No | Route statistics over the samples with data, bridging samples without data. | |
| vertices | No | Route vertices after dropping consecutive duplicates. | |
| attribution | No | Sources to credit for the returned values, one line per dataset that answered. | |
| source_mode | No | The source the call used (auto unless the caller chose one). | |
| datasets_used | No | Number of values each dataset answered. | |
| missing_samples | No | Samples no queried dataset answered. | |
| sample_interval_m | No | Distance between consecutive samples, meters: route length / (samples − 1). | |
| samples_with_data | No | Samples with an elevation. | |
| resolution_m_range | No | Range of source resolutions over values that report one; absent when none does (all Mapzen). |