GET /v1/buildings/{gmlid}/roof

Dachflächen mit Neigung & Ausrichtung (Solar-Keil)

beta seit v0.1.0 buildings auth: api_key · ab pro
Als Markdown anzeigen → Im Swagger-UI öffnen → operationId: get_building_roof_surfaces

Beispiel-Ergebnis

So sieht die Antwort aus

Ein Gebäude in Frankfurt-Mitte, von Süden gesehen. Seine Dachflächen sind nach Himmelsrichtung eingefärbt: Süd orange, Ost gelb, West grün, Nord blau, flach grau.
17 RoofSurfaces eines Gebäudes in Frankfurt-Mitte, eingefärbt nach azimuth_deg. Die größte Fläche liegt bei tilt_deg 26,8 und azimuth_deg 330,6 (Nord, 91 m²), die Süd-Flächen kommen zusammen auf rund 135 m². Gerendert aus der echten API-Antwort, kein Mockup. Daten: © Hessisches Landesamt für Bodenmanagement und Geoinformation (HLBG) (Wortlaut aus /v1/attribution (buildings, he; dl-de-zero-2.0))

Aufruf

curl -H "X-API-Key: $LODAPI_KEY" \
  https://api.lodapi.de/v1/buildings/DEHE06200001chAX/roof

Antwort (gekürzt, 1 von 17 Features)

{
  "type": "FeatureCollection",
  "count": 17,
  "features": [
    …,
    {
      "type": "Feature",
      "geometry": { "type": "Polygon", "coordinates": [[[8.66152014, 50.10878782, 117.61], …]] },
      "properties": {
        "surface_id": "4106130",
        "area_m2": 91.06,
        "area_sloped_m2": 102.04,
        "tilt_deg": 26.8,
        "azimuth_deg": 330.6,
        "bundesland_code": "he",
        "gmlid": "DEHE06200001chAX"
      }
    },
    …
  ],
  "lodapi": { "gmlid": "DEHE06200001chAX", "bl": "he" }
}

Darstellung: three.js. Dachpolygone aus der /roof-Antwort, Wände aus /v1/buildings?bbox=8.66,50.108,8.665,50.111. Farbe = Azimut-Sektor, grau = tilt_deg < 5.

GET /v1/buildings/{gmlid}/roof — Dachflächen mit Neigung & Ausrichtung (Solar-Keil)

Liefert eine GeoJSON-FeatureCollection aller con:RoofSurface-Polygone (objectclass_id 712 in 3DCityDB v5) eines Gebäudes, identifiziert über seine GML-id. Jedes Feature trägt aus der LoD2-Geometrie abgeleitete Solar-Attribute.

Zugang

Ab Tarif Pro, mit API-Key im Header X-API-Key. Ohne Key antwortet der Endpoint mit 401, mit einem Key unter Pro mit 403 (beides application/problem+json, mit Link auf Key bzw. Tarife). Einen Testkey bekommst du in einer Minute unter lodapi.de/key: 7 Tage gültig, Pro-Umfang, ohne Registrierung. Die Beispiele unten lesen den Key aus der Umgebungsvariable LODAPI_KEY.

Feature-Attribute

PropertyBeschreibung
tilt_degNeigung gegen die Horizontale (0–90°)
azimuth_degKompass-Ausrichtung der Außennormalen (0=N, 90=O, 180=S, 270=W); null bei nahezu flachen Flächen (tilt < 5°)
area_m2projizierte Dachfläche in m² (Grundriss, UTM, nicht die geneigte Fläche)
area_sloped_m2tatsächliche geneigte Dachfläche in m² (für Modulbelegung); null ab 85° Neigung

Eine leere FeatureCollection (count: 0) ist valide — für Gebäude, die im Datensatz existieren, aber keine RoofSurface-Features haben (z.B. SL-INSPIRE-Import, der nur Wand- + Bodenflächen liefert).

Path-Parameter

ParamTypeBeschreibung
gmlidstringGML-id des Gebäudes (z.B. DESHPDHK0001gXAH)

Example

curl -s -H "X-API-Key: $LODAPI_KEY" \
  https://api.lodapi.de/v1/buildings/DESHPDHK0001gXAH/roof

Python-SDK:

# pip install lodapi
import os

from lodapi import Client

with Client(api_key=os.environ["LODAPI_KEY"]) as c:
    roof = c.buildings.roof("DESHPDHK0001gXAH")
    print(roof.count)

Response

200 OK · application/json — GeoJSON-FeatureCollection:

{
  "type": "FeatureCollection",
  "count": 2,
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Polygon", "coordinates": [ ... ] },
      "properties": { "surface_id": "1308395", "area_m2": 52.64, "area_sloped_m2": 70.66, "tilt_deg": 41.8, "azimuth_deg": 332.0, "bundesland_code": "sh", "gmlid": "DESHPDHK0001gXAH" }
    }
  ],
  "lodapi": { "gmlid": "DESHPDHK0001gXAH", "bl": "sh" }
}

Der lodapi-Block nennt die aufgelöste gmlid + das Quell-Bundesland (bl).

Fehler

StatusBedingung
401Kein X-API-Key mitgeschickt (oder Key unbekannt/abgelaufen)
403Key-Tarif unter Pro
404gmlid in keinem aktiven Bundesland gefunden

Hinweise

  • Die Geometrie stammt aus dem LoD2-Bestand — Dachflächen sind ebene Facetten, nicht die reale gekrümmte Oberfläche.
  • azimuth_deg ist für Solar-Lead-Qualifizierung gedacht (Süd-Ausrichtung = hoher Ertrag); für die finale Ertragsrechnung gehört noch Verschattung dazu (volle Solar-API, Phase Q4 2026).

Verwandte Endpoints

Verwandt

  • /v1/buildings
  • /v1/buildings/{gmlid}

Bereit?

Der erste Call geht sofort.

LoD2-Gebäude für alle 16 Bundesländer, kostenlos und ohne Konto. Pro auf Anfrage 30 Tage testen.