Une mosaïque d overview par zone géographique, pas une grille globale
This commit is contained in:
@ -715,7 +715,9 @@ def test_overview_generated_for_large_grids(tmp_path):
|
||||
data = json.loads((output_dir / "index_tiles.json").read_text(encoding='utf-8'))
|
||||
ov = data['overview']
|
||||
assert 'hillshade_multi' in ov and 'svf' in ov
|
||||
meta = ov['hillshade_multi']
|
||||
items = ov['hillshade_multi']['items']
|
||||
assert len(items) == 1 # une seule zone géographique
|
||||
meta = items[0]
|
||||
assert (output_dir / meta['url'].split('?')[0]).is_file()
|
||||
assert meta['km_w'] == 3 and meta['km_h'] == 2
|
||||
assert meta['w'] == 3 * meta['px_per_km']
|
||||
@ -724,7 +726,33 @@ def test_overview_generated_for_large_grids(tmp_path):
|
||||
# La coquille HTML embarque la constante pour l'interface
|
||||
html = (output_dir / "index.html").read_text(encoding='utf-8')
|
||||
assert "const OVERVIEW" in html
|
||||
assert "index_overview/hillshade_multi.webp" in html
|
||||
assert "index_overview/hillshade_multi_" in html
|
||||
|
||||
|
||||
def test_overview_one_mosaic_per_zone(tmp_path):
|
||||
"""Zones géographiques distantes : une mosaïque PAR ZONE (pas une grille
|
||||
globale étirée sur des centaines de km aux coins introuvables)."""
|
||||
from lidar_pipeline.index import build_index
|
||||
|
||||
output_dir = tmp_path / "output"
|
||||
vis_dir = output_dir / "visualisations"
|
||||
vis_dir.mkdir(parents=True)
|
||||
# Deux clusters de 2×3 dalles, à ~400 km l'un de l'autre
|
||||
for col in (1000, 1001, 1002):
|
||||
for row in (6881, 6882):
|
||||
_make_fake_viz_dir(vis_dir, "a", col, row, ('hillshade_multi',))
|
||||
for col in (1400, 1401, 1402):
|
||||
for row in (6481, 6482):
|
||||
_make_fake_viz_dir(vis_dir, "b", col, row, ('hillshade_multi',))
|
||||
|
||||
assert build_index(output_dir) is not None
|
||||
data = json.loads((output_dir / "index_tiles.json").read_text(encoding='utf-8'))
|
||||
items = data['overview']['hillshade_multi']['items']
|
||||
assert len(items) == 2
|
||||
assert items[0]['km_w'] == 3 and items[0]['km_h'] == 2
|
||||
assert items[1]['km_w'] == 3 and items[1]['km_h'] == 2
|
||||
# Les deux mosaïques sont distinctes (coins différents)
|
||||
assert items[0]['corners'] != items[1]['corners']
|
||||
|
||||
|
||||
def test_overview_skipped_for_small_grids(tmp_path):
|
||||
|
||||
Reference in New Issue
Block a user