Terrain pixel sampling
GET https://api.trailsplits.com/tiles/v1/elevation/{release}/sample
Checked by a live probe Key optional · 500 credits a day without one
Pipe-separated lat,lon. Producer accepts up to 2048 points, clamps requested zoom to available backing data and returns one modelled metre height per point. null is missing, never zero. Does not densify or smooth a line. Example consumers impose smaller bounds. Unknown accuracy/source resolution is not surveyed truth.
Example
# Without a key, leave out the Authorization line (500 credits a day per address).
curl --fail-with-body 'https://api.trailsplits.com/tiles/v1/elevation/current/sample?points=46.5369000%2C12.1352000%7C46.5367714%2C12.1348857%7C46.5366429%2C12.1345714%7C46.5365143%2C12.1342571%7C46.5363857%2C12.1339429%7C46.5362571%2C12.1336286%7C46.5361286%2C12.1333143%7C46.5360000%2C12.1330000&z=12&encoding=mapbox' \
-H "Authorization: Bearer $TRAILSPLITS_API_KEY" Parameters
| Name | In | Description |
|---|---|---|
releaserequired | path | Published terrain version, or mutable current. Demo resolves/pins a version. |
pointsrequired | query | 1–2048 lat,lon pairs separated by |; example uses 8/16/32. |
z | query | Requested zoom; response z is the effective zoom. |
encoding | query | Use mapbox for the published terrain. Other encoding is compatibility input, not a second dataset. |
Response
| Field | Type | Description |
|---|---|---|
release | string | |
z | integer | |
z_requested | integer | |
encoding | string: mapbox | terrarium | |
points | array |
Full response schema (JSON Schema)
{
"type": "object",
"properties": {
"release": {
"type": "string"
},
"z": {
"type": "integer",
"minimum": 0,
"maximum": 22
},
"z_requested": {
"type": "integer"
},
"encoding": {
"type": "string",
"enum": [
"mapbox",
"terrarium"
]
},
"points": {
"type": "array",
"items": {
"type": "object",
"properties": {
"lat": {
"type": "number"
},
"lon": {
"type": "number"
},
"elevation_m": {
"type": "number",
"nullable": true
}
},
"required": [
"lat",
"lon",
"elevation_m"
]
}
}
},
"required": [
"release",
"z",
"encoding",
"points"
]
}Errors
400, 404, 500, plus the gateway's 401, 429 and 503 (error conventions). A refused request costs no credits.