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/, 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
| Property | Beschreibung |
|---|---|
tilt_deg | Neigung gegen die Horizontale (0–90°) |
azimuth_deg | Kompass-Ausrichtung der Außennormalen (0=N, 90=O, 180=S, 270=W); null bei nahezu flachen Flächen (tilt < 5°) |
area_m2 | projizierte Dachfläche in m² (Grundriss, UTM, nicht die geneigte Fläche) |
area_sloped_m2 | tatsä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
| Param | Type | Beschreibung |
|---|---|---|
gmlid | string | GML-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/ — 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
| Status | Bedingung |
|---|---|
401 | Kein X-API-Key mitgeschickt (oder Key unbekannt/abgelaufen) |
403 | Key-Tarif unter Pro |
404 | gmlid 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_degist 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
GET /— Gebäude per Bbox finden (liefertv1/ buildings gmlid).GET /— Gebäude-Detailgeometrie.v1/ buildings/ {gmlid}