index.py rewritten as a continuous Leaflet map: rotated L93 tiles, stackable visualization layers (per-layer opacity, drag-reorder persisted in localStorage), tile info panel, live rebuild after each tile during a run. Leaflet is vendored in assets/vendor/ so the map works fully offline; georeferencing falls back rasterio -> pyproj -> affine so the lightweight webapp (no GDAL) is supported. docker-compose.worker.yml adds the tile generator service (full image + GPU) that remote webapps call via LIDAR_GENERATION_URL, plus a one-shot process profile. webapp.py gains LIDAR_AUTO_SYNC_SECONDS periodic cache refresh and LIDAR_REGEN_CIDR restricting generation to the local network. run.sh --serve-webapp now mounts ~/.ssh read-only so the rsync sync works. docs/DEPLOY_WEBAPP.md completed for Raspberry Pi deployment: prerequisites, git clone install, SSH key setup, first sync, update procedure and troubleshooting.
4.3 KiB
4.3 KiB
Workflow
- install:
docker build -t lidar-lidar .(deps baked into image) - build:
docker build -t lidar-lidar . - build webapp légère (Raspberry Pi, déploiement 2 machines — cf.
docs/DEPLOY_WEBAPP.md):docker compose -f docker-compose.webapp.yml up -d --build(imageDockerfile.webapp, sans PDAL/GPU) - build générateur de tuiles (machine de traitement):
docker compose -f docker-compose.worker.yml up -d --build(serviceworker, API pour les webapp distantes) - test all:
./run.sh --test(rebuild automatique de l'image avant les tests ; endocker rundirect, rebuild manuellement d'abord) - test file:
docker run --rm lidar-lidar python3 -m pytest -v --pyargs lidar_pipeline.tests.<module> - test case:
docker run --rm lidar-lidar python3 -m pytest -v --pyargs lidar_pipeline.tests.<module>::<TestClass>::<test_method> - lint: not configured
- format: not configured
- after every edit:
./run.sh --test - RÈGLE 1 — toujours lancer via docker compose (jamais
docker rundirect) : carte/API →docker compose up -d --build serve(port 8973) ; traitement ponctuel →docker compose run --rm --build process [options]; logs →docker compose logs -f serve; arrêt →docker compose down. - RÈGLE 2 — TOUJOURS
--build: le code est baké dans l'image (jamais monté). Sans--build,up/runréutilisent l'image existante et l'ANCIEN code tourne.--buildest quasi instantané grâce au cache (le .dockerignore exclut input/ et output/ du contexte). Après édition :docker compose up -d --build serverecrée le conteneur sur du neuf. - test rapide sans rebuild (code monté par-dessus l'image):
docker run --rm -e PYTHONPATH=/app -v $(pwd)/lidar_pipeline:/app/lidar_pipeline lidar-lidar python3 -m pytest --pyargs lidar_pipeline.tests - debug:
./run.sh --debug(file:line logging); container shell:docker run --rm -it -v $(pwd)/input:/data/input -v $(pwd)/output:/data/output --entrypoint bash lidar-lidar
Conventions
- Bilingual naming: all code identifiers are English; every user-facing string, log message, argparse help, and comment is French.
- Adding a visualization requires 3 edits: (1)
generate_X()invisualizations.py, (2) entry inVIZ_STEPSinpipeline.py, (3) entry inCOLORMAPSinrendering.py. Missing any one breaks the pipeline. generate_*signature is strict:(dem_file, basename, vis_dir, resolution, shared=None)returningPathon success,Noneon failure. IGN overlays (ortho,topo) omitshared.- Return
Noneon failure, never raise:dtm.py,visualizations.py, andign.pyall returnNoneto let the pipeline continue. Raising aborts the entire file. - Logger is always
logging.getLogger("lidar"), never__name__. All modules route through this single logger so worker processes can configure it. - Filename special-cases in
_expected_output_path():pos_open→positive_openness,neg_open→negative_openness,hillshade→hillshade_multi. - Default output is AVIF, not WebP. Use
--format webpfor WebP. Quality default is 98. - Tests use lazy imports inside each test function, never at module top, to avoid importing CuPy/GDAL at import time.
_-prefixed names are critical private:_create_ground_pipeline,_fallback_to_smrf,_fill_nans,_init_gpu,_process_file_standalone— do not call from outside their module.build_index()writes 3 files:output/index.html(data shell,const TILESembedded),output/assets/app.cssandoutput/assets/app.js(source:_APP_CSS/_APP_JSconstants inindex.py).webapp.pyserves/assetswith no-cache headers. Each tile carriesmeta— ground method read fromDTM/*_dtm{_rXpY}_method.txt(falls back to the primary-resolution sidecar) + per-viz dates/sizes.
Commit & Pull Request Guidelines
Commits use imperative tense, short single-line subjects (~60–80 chars), no prefixes or scopes. Compound commits are common — multiple related changes joined by commas or "and". Examples: Fix multi-GPU with lazy CuPy init + rendering improvements, Add multi-resolution support and remove PDF generation, Fix corrupted COPC detection, add CSF→SMRF fallback, improve MSRM colormap, add SVF and anisotropic openness.
No PR template, no CI pipeline, no issue tracker. This is a standalone Docker project with no formal PR process.