Visual checks and demo¶
plot_polygon¶
Requires the viz extra (pip install "pypvroof[viz]").
from pypvroof.viz import plot_polygon
fig = plot_polygon(polygon, services=("fr-lidar", "fr-correl"))
fig.savefig("check.png", dpi=150)
The figure shows the orthophoto (IGN BD ORTHO, France only; ortho=True/False,
by default when the first service is an IGN one) and, below, the elevation grid
of each service around the polygon (margin, 6 m), with the estimated tilt and
azimuth.
polygon can be a GeoJSON feature or geometry, a shapely polygon, or a one-row
GeoDataFrame (CRS from crs, default EPSG:4326). services accepts any
service specification ("nl-ahn", a folder, a DSMService...).
Web demo¶
The Gradio app (app/) is deployed on
Hugging Face Spaces.
- Draw on the map: draw a polygon on a roof; the surface model covering the location is queried and the characteristics are computed on the fly. Polygons covering several roof planes are split, and the planes drawn back on the map.
- Upload polygons: GeoJSON, GeoPackage or GeoParquet; results as a table and a GeoJSON to download.
Run it locally from the repository root:
The number of polygons per run is capped by PYPVROOF_MAX_POLYGONS (default 200).