Digital Elevation Model (DEM) API Documentation

The DEM API allows you to retrieve elevation data and contour lines for your geometries.

Authentication: All API endpoints require an API key to be passed in the X-API-Key header.

Get Elevation Data

Endpoint
GET /api/dem/
Description

Get elevation data for a specific geometry.

Query Parameters
Parameter Type Required Description
geometry_id UUID Yes UUID of the geometry
format string No Output format (geotiff, png, json). Default: geotiff
resolution number No Resolution in meters. Default: 30
colormap string No Colormap for visualization (terrain, viridis, plasma, etc.). Default: terrain
Headers
Name Required Description
X-API-Key Yes Your API key in UUID format
Response

Returns elevation data in the requested format.

Example Response (200 OK) - JSON format
{
  "geometry_id": "123e4567-e89b-12d3-a456-426614174000",
  "statistics": {
    "min_elevation": 120.5,
    "max_elevation": 450.2,
    "mean_elevation": 285.7,
    "std_deviation": 75.3
  },
  "resolution": 30,
  "crs": "EPSG:4326",
  "data": [
    [120.5, 125.3, 130.2, ...],
    [122.1, 128.7, 135.6, ...],
    ...
  ]
}

For GeoTIFF and PNG formats, the response will be the binary file data with appropriate content type headers.

Error Responses
Status Code Description
400 Bad Request - Missing or invalid parameters
401 Unauthorized - Missing API key
403 Forbidden - Invalid API key
404 Not Found - Geometry not found
500 Internal Server Error

Get Contour Lines

Endpoint
GET /api/contours/
Description

Get contour lines for a specific geometry.

Query Parameters
Parameter Type Required Description
geometry_id UUID Yes UUID of the geometry
interval number No Contour interval in meters. Default: 10
format string No Output format (geojson, png). Default: geojson
resolution number No Resolution in meters for underlying DEM. Default: 30
Headers
Name Required Description
X-API-Key Yes Your API key in UUID format
Response

Returns contour lines in the requested format.

Example Response (200 OK) - GeoJSON format
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [longitude1, latitude1],
          [longitude2, latitude2],
          ...
        ]
      },
      "properties": {
        "elevation": 100
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [longitude1, latitude1],
          [longitude2, latitude2],
          ...
        ]
      },
      "properties": {
        "elevation": 110
      }
    },
    ...
  ]
}

For PNG format, the response will be the binary image data with appropriate content type headers.

Error Responses
Status Code Description
400 Bad Request - Missing or invalid parameters
401 Unauthorized - Missing API key
403 Forbidden - Invalid API key
404 Not Found - Geometry not found
500 Internal Server Error

DEM Data Sources

The DEM API uses the following data sources:

Source Resolution Coverage Description
SRTM 30m Global (60°N - 56°S) Shuttle Radar Topography Mission data
ASTER GDEM 30m Global (83°N - 83°S) Advanced Spaceborne Thermal Emission and Reflection Radiometer Global Digital Elevation Model
Copernicus DEM 30m Global Digital Elevation Model from the Copernicus program