Repository navigation
feat(wildfire): EFFIS perimeters from ms:modis.ba.poly, with the layer on every row - #760
Merged
Merged
Conversation
…r on every row (#714) The two EFFIS burnt-area layers do not count the same fires, and nrt.ba.poly also counts heat that is not burnt vegetation (255 burnt areas on the summit of Etna). Limen now reads ms:modis.ba.poly. Migration 104 adds the layer to every perimeter (key (layer, id), no default), the attributes only the new layer has, and the view v_fire_perimeters that every reader and the map go through. Existing rows are kept and marked nrt.ba.poly. effis-sync reads the new layer through effis-client 0.3.0. The severity anchors keep their values and are marked to be measured again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Limen reads the EFFIS burnt-area layer
ms:modis.ba.polyinstead ofnrt.ba.poly, as decided on 2026-11-28. The reason is in effis-client 0.3.0: the two layers do not count the same fires, andnrt.ba.polyalso counts heat that is not burnt vegetation. On the summit of Etna it has 255 "burnt areas" from 2012 to 2026 (135,917 ha);ms:modis.ba.polyhas 6 fires there. Accepted costs: the new layer starts in 2016, and its rows are revised over time.This PR moves measured numbers: do not merge it without deciding to rerun the measures listed below.
What changes
104_effis_layer.sql):layercolumn tofire_perimeters,NOT NULL, with no default (whoever writes must say the layer) and aCHECKon the two names.(layer, id): ids of the two layers have the same shape and can collide.municipality,final_date,last_update,land_cover_pct(jsonb, percent of the burnt area per cover),natura2000_pct.layer = 'nrt.ba.poly'. Nothing is deleted. Removing them is a separate step for the user to approve.v_fire_perimeters, which holds only Limen's layer:backtest_wildfire);fire_check,perimeter_severity_at);UPDATEthrough the auto-updatable view; rows of the other layer keep their values);frp_size_correlation, the measures (misure_repo), the data catalogue and theeffis-syncfingerprint.limen_tilesgetsSELECTonv_fire_perimetersand loses it on the table, otherwise the map would draw both layers.effis-syncreadsMODIS_LAYERatEFFIS_WFS_URLthrough effis-client 0.3.0._parse_featurenow useseffis_client.perimeter_attributes, which removes Limen's own field lookup (id, date, area, country, province) and adds municipality, last update and land cover. The geometry handling stays in Limen.STEP_VERSION["fire_perimeters"]goes from 1 to 2, so the static bootstrap syncs again.fire_repo.PERIMETER_LAYER, is the layer of the writes; a unit test checks it is the client's layer and the one in the view's definition.Severity anchors: to be measured again, values unchanged
post_fire.frp_floor_mw_per_ha: 0.08andpost_fire.frp_saturation_mw_per_ha: 0.88are insrc/limen/config/hazards/landslide.yaml, not in wildfire.yaml. They are the 10th and 90th percentile of the FRP density on 2,419 Italian EFFIS perimeters 2012-2024 of the old layer. Their values do not change here; the YAML now says they must be measured again, with the query. The original query is not in the repository (commit 6fd7556 has only the numbers); this one rebuilds it from the definition:The correlations with the area (0.63 for the sum, 0.26 for the density) come from
fire_events_repo.frp_size_correlation().Measures in docs/misure that used the old layer and must be rerun
After
limen effis-syncwith the history (LIMEN_EFFIS_GIORNIback to 2016) and the FRP refresh:The wildfire backtests with EFFIS truth, first. 94 files
backtest_wildfire_*.mdwhose truth is "perimetri EFFIS" or "perimetri EFFIS e catasti regionali":backtest_wildfire_italia_*(2024, 2025, 2026: High, VeryHigh, cancello 0.3/0.5, tetto 95-35);The ones with
_catastiin the name and truth "catasti" alone do not read EFFIS and stay valid.misura_coltivi_2023_2024-2026.md: the verification truth is EFFIS perimeters 2024-2026.The severity anchors above, and with them every score that uses the post-fire factor F.
The EFFIS/FIRMS agreement of
limen ingest-fire-history(report inreports/, not in docs/misure): it compares FIRMS with the perimeters.Not in this PR, as agreed: replacing
fire_events_repo._REFRESH_FRP_SQLwithlimen_core.wildfire.seen_inside_all. It is a separate PR after this one, and the right place to measure the anchors again with the function that will compute the density.Epic
Part of #714 (wildfire)
Type of change
Verification
ruff check src tests,ruff format --check,mypy(strict, 475 files): clean.test_geoserver_dati_base.py::test_il_raster_corine_dallo_shapefile. It fails the same way on main in my local environment, so it is not caused by this PR.effis-syncasksms:modis.ba.polyon/effisand stores municipality, last update, land cover and Natura 2000;effis-syncagainst the live service on a database with data.Risk/scoring impact
effis-syncruns with the history, the view is empty: the wildfire backtest has no truth and the post-fire factor F sees no perimeter, so F stays at its value without severity.nrt.ba.polyrows stay in the table, invisible to every reader, until the user decides to remove them.🤖 Generated with Claude Code