---
operation_id: get_building_roof_surfaces
method: GET
path: /v1/buildings/{gmlid}/roof
summary: RoofSurfaces with tilt, azimuth and area for solar analysis
tags: [buildings]
stability: beta
since_version: 0.1.0
auth: none
data_product: buildings
snapshot_aware: true
attribution_block: true
rate_limit_tier: public
related:
  - /v1/buildings
  - /v1/buildings/{gmlid}
---
# `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.

## 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² (UTM, **nicht** die geneigte Fläche) |

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. `DEBBAL0100000001`) |

## Example

```bash
curl https://api.lodapi.de/v1/buildings/DEBBAL0100000001/roof
```

## Response

`200 OK · application/json` — GeoJSON-FeatureCollection:

```json
{
  "type": "FeatureCollection",
  "count": 2,
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Polygon", "coordinates": [ ... ] },
      "properties": { "tilt_deg": 38.2, "azimuth_deg": 178.4, "area_m2": 54.1 }
    }
  ],
  "lodapi": { "gmlid": "DEBBAL0100000001", "bl": "bb" }
}
```

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

## Fehler

| Status | Bedingung |
|---|---|
| `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_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

- [`GET /v1/buildings`](./list-buildings-bbox.md) — Gebäude per Bbox finden (liefert `gmlid`).
- [`GET /v1/buildings/{gmlid}`](./get-building-detail.md) — Gebäude-Detailgeometrie.