Ajouter des exemples au README et adapter la légende PDF aux hachures sans donnée
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
16
README.md
16
README.md
@ -84,6 +84,22 @@ lidar_pipeline/
|
||||
|
||||
Ajouter une visualisation = 1 fonction + 1 entrée dans `VIZ_STEPS` + 1 entrée dans `COLORMAPS`.
|
||||
|
||||
## Exemples
|
||||
|
||||
Relief orienté sur deux dalles LiDAR HD, rendues par ce pipeline (`./start.sh process --fetch-tiles 1037,6779 1011,6760 ...`).
|
||||
|
||||
**Neuf-Brisach** (dalle 1037_6779) — l'enceinte bastionnée de Vauban, ses fossés et ses demi-lunes ; en noir, les bâtiments (aucun point sol).
|
||||
|
||||

|
||||
|
||||
**Hartmannswillerkopf** (dalle 1011_6760) — versant forestier du champ de bataille de 1915 : chemins, tranchées et trous d'obus sous le couvert.
|
||||
|
||||

|
||||
|
||||
**Planche PDF** exportée depuis la carte (onglet PDF, A4 paysage, 1:5 000) : quadrillage Lambert 93, légende, encart qualité des données.
|
||||
|
||||

|
||||
|
||||
## Démarrage rapide
|
||||
|
||||
```bash
|
||||
|
||||
BIN
docs/img/hartmannswillerkopf.png
Normal file
BIN
docs/img/hartmannswillerkopf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 MiB |
BIN
docs/img/neuf-brisach-a4.png
Normal file
BIN
docs/img/neuf-brisach-a4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 712 KiB |
BIN
docs/img/neuf-brisach.png
Normal file
BIN
docs/img/neuf-brisach.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 MiB |
@ -469,7 +469,7 @@ def _draw_legend(c, box, mm):
|
||||
c.drawRightString((bx + bw) * mm, (by - 2.8) * mm, _pdf_text("bosse, crête"))
|
||||
c.drawString(bx * mm, (by + bh + 0.8) * mm, _pdf_text("Clarté = micro-relief"))
|
||||
# Rose des orientations (couleur = orientation de la pente)
|
||||
r_out, r_in = 11.0, 5.0
|
||||
r_out, r_in = 8.5, 3.9 # place pour les 4 phrases de lecture
|
||||
rcx, rcy = x + r_out + 2, by - 5 - r_out - 2
|
||||
for deg in range(0, 360, 5):
|
||||
c.setFillColor(HexColor(_hex(rose_color(deg))))
|
||||
@ -490,16 +490,23 @@ def _draw_legend(c, box, mm):
|
||||
# Texte de légende ("Comment lire" : phrases habillées à la largeur de la boîte)
|
||||
from reportlab.pdfbase.pdfmetrics import stringWidth
|
||||
ty = rcy - r_out - 6
|
||||
c.setFont("Helvetica", 5.8)
|
||||
c.setFont("Helvetica", 5.2) # 4 phrases dans la boîte, A4 compris
|
||||
for sentence in VIZ_LEGENDS[LAYER].get("reading") or VIZ_LEGENDS[LAYER]["legend"].split("\n"):
|
||||
# Sur la planche, les pixels sans point sol sont hachurés en blanc
|
||||
# (pas noirs comme sur la carte) : même phrase, repère adapté.
|
||||
if sentence.startswith("Trous noirs"):
|
||||
sentence = "Hachures blanches" + sentence[len("Trous noirs"):]
|
||||
# La teinte est déjà légendée à côté de la rose : phrase redondante.
|
||||
if sentence.startswith("Teinte = orientation"):
|
||||
continue
|
||||
line = ""
|
||||
for word in _pdf_text(sentence).split(" "):
|
||||
test = (line + " " + word).strip()
|
||||
if stringWidth(test, "Helvetica", 5.8) * 0.3528 > w and line: # pt → mm
|
||||
if stringWidth(test, "Helvetica", 5.2) * 0.3528 > w and line: # pt → mm
|
||||
if ty < y + 1:
|
||||
return
|
||||
c.drawString(x * mm, ty * mm, line)
|
||||
ty -= 2.9
|
||||
ty -= 2.5
|
||||
line = word
|
||||
else:
|
||||
line = test
|
||||
@ -507,7 +514,7 @@ def _draw_legend(c, box, mm):
|
||||
if ty < y + 1:
|
||||
return
|
||||
c.drawString(x * mm, ty * mm, line)
|
||||
ty -= 3.6 # interligne un peu plus grand entre deux phrases
|
||||
ty -= 3.1 # interligne un peu plus grand entre deux phrases
|
||||
|
||||
|
||||
def _draw_quality(c, box, bbox, zq, mm):
|
||||
|
||||
Reference in New Issue
Block a user