Skip to content

Quickstart

Tilt and azimuth from a surface model

from pypvroof import characterize_roofs

out = characterize_roofs("detections.geojson", "fr-lidar", workers=8)
  • The input can be a GeoDataFrame, a GeoJSON file or dict, a (Geo)Parquet or GeoPackage file, a list of shapely polygons...
  • "fr-lidar" is a service of the catalogue; a folder of GeoTIFFs works too.
  • The output is a GeoDataFrame, in the CRS of the input, with tilt, azimuth, surface, a status and the service metadata (meta_*).
out.status.value_counts()
ok = out[out.status.isin(["ok", "flat"])]

No fallback

When a value cannot be measured, it is NaN and status says why (no_coverage, multimodal, too_few_points...). Try another service, split the polygon (split=True) or use the heuristics (service=None). See Bulk characterization.

Which service covers my polygons?

import pypvroof
from pypvroof.catalog import services_at

pypvroof.available_services()     # table of the catalogue
services_at(2.35, 48.85)          # ['fr-lidar', 'fr-correl']

Installed capacity and roof planes

out = characterize_roofs("detections.geojson", "fr-lidar", split=True, capacity="clustered")
out[["parent_id", "part", "tilt", "azimuth", "surface", "installed_capacity"]]

capacity is "constant" (1/6.5 kWp/m²), "linear", "clustered" or a coefficient in kWp/m². For a surface computed elsewhere:

from pypvroof import installed_capacity
installed_capacity(25.0, "clustered")

Without a surface model

out = characterize_roofs("detections.geojson", None, tilt=30, capacity="constant")

Constant tilt, azimuth from the polygon's minimum rotated rectangle (the side closest to south), elongation of that rectangle, status = "heuristic".

Visual check

from pypvroof.viz import plot_polygon
fig = plot_polygon(polygon, services=("fr-lidar", "fr-correl"))