Get started
Data API

Terrain

Terrain

Three queries read the surface itself, independently of any route. Pick the one that matches the shape of the question:

  • terrainSamples for readings at coordinates you already know.
  • terrainProfile for readings along a line — an elevation profile as data.
  • terrainGrid for readings across an area whose features are not yet located, such as finding high ground or a slope facing a given direction.

All three return the same TerrainSample shape and read from the same digital elevation model, so a value means the same thing whichever query produced it. Coordinates are [longitude, latitude] in WGS 84, elevations are in meters above sea level, and slope is in degrees.

The sample

point

[Float!]!

Echo of the sampled [longitude, latitude].

elevation

Float

Meters above sea level. Null outside DEM coverage.

slope

Float

Slope angle in degrees. Null outside DEM coverage.

aspect

Float

Downhill compass bearing, 0-360, where 0 is north. Null outside DEM coverage, and null on flat ground, which has no downhill direction.

aspectOctant

AspectOctant

aspect as a compass octant: NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST. Null whenever aspect is null.

steepnessBand

SteepnessBand

FROM_25_TO_30, FROM_30_TO_35, FROM_35_TO_40, FROM_40_TO_45, or ABOVE_45. Null below 25 degrees and outside DEM coverage.

distanceMeters

Float

Distance along the geometry from its start. Populated by terrainProfile only; null in a terrainSamples or terrainGrid result.

aspectOctant and steepnessBand use the same vocabulary as the aspect and steepness map overlays, so a value you read here matches the legend a user sees on the map.

Every result also carries zoom and resolutionMeters, the DEM tile zoom the reading was taken at and the ground distance one pixel covers there, so a reading can be reproduced later.

terrainSamples

Readings at specific points.

Input

terrainSamples(input: TerrainSamplesInput!)

locations

[[Float!]!]!

required

Between 1 and 100 [longitude, latitude] pairs.

Example

query TerrainSamples($input: TerrainSamplesInput!) {
  terrainSamples(input: $input) {
    count
    coveredCount
    zoom
    resolutionMeters
    samples {
      point
      elevation
      slope
      aspect
      aspectOctant
      steepnessBand
    }
  }
}

Response

TerrainSamplesResult returns count, coveredCount, zoom, resolutionMeters, and samples, one entry per requested location in the order you sent them.

terrainProfile

Readings along a line: the elevation profile of a geometry, as data.

Input

terrainProfile(input: TerrainProfileInput!)

coordinates

[[Float!]!]!

required

Ordered [longitude, latitude] pairs forming the geometry.

spacingMeters

Float

default: 100

Target sampling interval in meters, between 10 and 1000.

Example

query TerrainProfile($input: TerrainProfileInput!) {
  terrainProfile(input: $input) {
    count
    coveredCount
    resolutionMeters
    samples {
      point
      distanceMeters
      elevation
      slope
    }
  }
}

Response

TerrainProfileResult has the same shape as TerrainSamplesResult, and its samples carry distanceMeters.

terrainGrid

Readings across an area, on a regular lattice.

Input

terrainGrid(input: TerrainGridInput!)

bbox

[Float!]!

required

[minLongitude, minLatitude, maxLongitude, maxLatitude].

cols

Int

default: 16

Number of grid columns, between 2 and 64.

rows

Int

default: 16

Number of grid rows, between 2 and 64.

Example

query TerrainGrid($input: TerrainGridInput!) {
  terrainGrid(input: $input) {
    count
    coveredCount
    cols
    rows
    resolutionMeters
    cells {
      point
      elevation
      slope
      aspectOctant
    }
  }
}

Response

TerrainGridResult returns the samples as cells rather than samples, and echoes the cols and rows it laid them out on, so a flat list maps back onto the lattice by index.

Next steps