GET /v1/terrain/profile

Höhenprofil entlang einer Polyline

stable seit v0.1.0 terrain auth: none

GET /v1/terrain/profile — Höhenprofil entlang einer Linie

Sampelt die Geländehöhe (DHHN2016) an N gleichverteilten Punkten entlang einer WGS84-Polyline. Liefert GeoJSON-FeatureCollection mit kumulierten Distanzen + Pro-Tile-Quellen-Tracking.

Wann verwenden

Für eine einzelne Punktabfrage ist /v1/terrain/elevation schneller — /profile öffnet pro betroffenem Tile eine separate COG-Sample-Operation (Batch-optimiert).

Examples

curl — 500 Punkte über 10 km

curl -s 'https://api.lodapi.de/v1/terrain/profile?coords=13.37,52.51;13.45,52.55&samples=500' \
  | jq '.properties, .features[0]'

Python — Chart-Datenpunkte

import httpx, json

r = httpx.get(
    "https://api.lodapi.de/v1/terrain/profile",
    params={"coords": "13.37,52.51;13.40,52.53;13.45,52.55", "samples": 200},
)
data = r.json()
chart = [
    (f["properties"]["distance_m"], f["properties"]["elevation_m"])
    for f in data["features"]
    if f["properties"]["elevation_m"] is not None
]
print(f"Total length: {data['properties']['total_length_m']:.0f} m, {len(chart)} valid samples")

Parameters

ParameterInTypeRequiredDefaultRangeBeschreibung
coordsquerystringyes≥ 2 Punktelon1,lat1;lon2,lat2[;...] WGS84 Grad
samplesqueryintno1002..2000Anzahl Sample-Punkte

Response

200 OK · application/json — GeoJSON-FeatureCollection (RFC 7946) mit Lodapi-Erweiterungen in properties.

{
  "type": "FeatureCollection",
  "properties": {
    "datum": "DHHN2016",
    "coords_count": 3,
    "samples": 200,
    "total_length_m": 9543.7,
    "partial": false,
    "failed_tile_ids": []
  },
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Point", "coordinates": [13.37, 52.51] },
      "properties": {
        "elevation_m": 38.4,
        "distance_m": 0.0,
        "source_bl": "be",
        "tile_id": "be_33_387_5821"
      }
    }
  ]
}

Partial-Modus

properties.partial: true zeigt an, dass mindestens ein Sample außerhalb der Coverage liegt oder bei der COG-Sample-Operation gescheitert ist:

Fehler

StatusBedingung
400coords malformed oder < 2 Punkte
404Alle Samples außerhalb Coverage
422samples out of range
502DB unerreichbar

Stolperdrähte

Verwandte Endpoints

Verwandt

Bereit?

Hol dir deinen API-Key.

1.000 Calls und 1 GB Tile-Daten kostenlos pro Monat — ohne Kreditkarte, ohne Ablaufdatum.