Get started

Terrain

The terrainSamples, terrainProfile and terrainGrid queries of the Data API. Every request is a POST to https://data.mountaya.com/graphql with a publishable key and a session token: see Authentication.

terrainSamples

POST
/graphql

Sample elevation, slope, and aspect at standalone [longitude, latitude] points. Use it for readings at known coordinates; for an existing line use terrainProfile, and to search an area for features you have not located use terrainGrid.

Arguments

input

TerrainSamplesInput!

required

The positions to sample terrain at.

Returns

terrainSamples

TerrainSamplesResult!

required

Result of a point terrain query.

Errors A field the API refuses is answered 200, its entry in errors beside the data that resolved. See Errors.

curl https://data.mountaya.com/graphql \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query TerrainSamples($input: TerrainSamplesInput!) { terrainSamples(input: $input) { count samples { elevation } } }",
    "variables": {
      "input": {"locations": [[6.8712, 45.9231], [6.865, 45.8326]]}
    }
  }'

terrainProfile

POST
/graphql

Sample the surface along a geometry at a fixed interval, producing an elevation profile as data. Use it to answer how steep a route is and where the hard sections sit.

Arguments

input

TerrainProfileInput!

required

The line to profile, and the spacing to sample it at.

Returns

terrainProfile

TerrainProfileResult!

required

Result of a terrain profile along a geometry.

Errors A field the API refuses is answered 200, its entry in errors beside the data that resolved. See Errors.

curl https://data.mountaya.com/graphql \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query TerrainProfile($input: TerrainProfileInput!) { terrainProfile(input: $input) { count samples { elevation } } }",
    "variables": {
      "input": {
        "coordinates": [[6.8712, 45.9231], [6.9271, 45.9822]],
        "spacingMeters": 1000
      }
    }
  }'

terrainGrid

POST
/graphql

Sample the surface over a rectangular grid inside a bounding box, for area reconnaissance: finding high ground, a steep band, or a slope facing a given direction before routing through it.

Arguments

input

TerrainGridInput!

required

The bounding box to grid, and the resolution to sample it at.

Returns

terrainGrid

TerrainGridResult!

required

Result of a gridded terrain query over an area.

Errors A field the API refuses is answered 200, its entry in errors beside the data that resolved. See Errors.

curl https://data.mountaya.com/graphql \
  -H "X-API-Key: pk_your_publishable_key" \
  -H "X-Session-Token: sess_your_session_token" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query TerrainGrid($input: TerrainGridInput!) { terrainGrid(input: $input) { cells { elevation } cols rows } }",
    "variables": {
      "input": {"bbox": [6.85, 45.83, 6.89, 45.86], "cols": 2, "rows": 2}
    }
  }'