Ajouter la géométrie de planche PDF, l'accès aux sources par emprise L93 et reportlab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Antoine Jacquin
2026-09-27 15:35:21 +02:00
parent 3b4d106cc2
commit 0955856876
6 changed files with 235 additions and 17 deletions

View File

@ -166,6 +166,20 @@ def test_pick_tier_by_resolution(tmp_path):
assert tiles._pick_tier(tiers, 0.01)[0].res == tiers[-1][0].res
def test_sources_in_bbox_picks_tier(tmp_path):
from lidar_pipeline import tiles
_make_dalle(tmp_path, 1054, 6882, ["aspect"], px=64)
tiles.source_index(tmp_path, force=True)
bbox = (1054000.0, 6881000.0, 1055000.0, 6882000.0)
fine = tiles.sources_in_bbox(tmp_path, "aspect", bbox, 0.2)
coarse = tiles.sources_in_bbox(tmp_path, "aspect", bbox, 50.0)
assert fine and coarse and fine[0][0] == (1054, 6882)
assert min(s.res for _c, s in fine) <= min(s.res for _c, s in coarse)
assert tiles.sources_in_bbox(tmp_path, "aspect", (0, 0, 10, 10), 0.2) == []
img = tiles.load_source(fine[0][1])
assert img is not None and img.mode in ("RGB", "RGBA")
def test_subtiles_preferred_over_full_dalle(tmp_path):
"""Les quadrants index_subtiles servent de palier fin (4× moins à décoder)."""
import pytest