Skip to content

Conversation

@conbrad
Copy link
Collaborator

@conbrad conbrad commented Dec 12, 2025

Adds new SFMS Insights page with interactive map visualization of fire weather raster data (GeoTIFF) from BC government object store.

Features:

  • 6 Fire Weather Indices: FWI, DMC, DC, FFMC, BUI, ISI with proper color ramps and class breaks
  • Dynamic Visualization: Hover tooltips showing pixel values, auto-updating legend per raster type
  • Date Picker: ASA-style date picker for historical and forecast data
  • Snow Layer: PMTiles-based snow coverage overlay
  • Loading/Error States: Visual feedback during raster tile loading
  • wps_tools.generate_sfms_cog script and launch config to selectively generate COGs for the frontend (currently ran for June 27, 2025)

Technical Implementation:

  • Backend: FastAPI proxy endpoint for streaming S3 GeoTIFF files (bypasses CORS, supports Range requests, requires auth)
  • Frontend: WebGLTile layers with dynamic color expressions, requesting cogs from object store proxy
  • NoData Handling: Dual approach (GeoTIFF source parameter + color expression thresholds)
  • Config-Driven: Centralized RASTER_CONFIG for labels and color breaks across all raster types

Closes #4169
Closes #4170
Closes #4182
Closes #4161
Closes #4171
Closes #4183
Closes #4959

Test Links:

Landing Page
MoreCast
Percentile Calculator
C-Haines
FireCalc
FireCalc bookmark
Auto Spatial Advisory (ASA)
HFI Calculator
SFMS Insights
Fire Watch

@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 88.69374% with 103 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.36%. Comparing base (75f7ea7) to head (22ace38).

Files with missing lines Patch % Lines
...atures/sfmsInsights/components/map/layerManager.ts 81.81% 3 Missing and 13 partials ⚠️
...c/features/sfmsInsights/components/map/SFMSMap.tsx 67.50% 6 Missing and 7 partials ⚠️
...es/sfmsInsights/components/map/layerDefinitions.ts 50.00% 10 Missing and 2 partials ⚠️
...fmsInsights/components/map/rasterTooltipHandler.ts 69.23% 7 Missing and 5 partials ⚠️
...shared/src/wps_shared/tests/geospatial/test_cog.py 92.80% 6 Missing and 3 partials ⚠️
...api/src/app/tests/utils/test_object_store_proxy.py 96.58% 7 Missing and 1 partial ⚠️
...nsights/components/map/RasterErrorNotification.tsx 80.00% 4 Missing and 3 partials ⚠️
...ckages/wps-shared/src/wps_shared/geospatial/cog.py 70.00% 3 Missing and 3 partials ⚠️
...nsights/components/map/rasterTooltipInteraction.ts 83.33% 0 Missing and 5 partials ⚠️
...ures/sfmsInsights/components/map/RasterTooltip.tsx 63.63% 3 Missing and 1 partial ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4949      +/-   ##
==========================================
+ Coverage   74.86%   75.36%   +0.49%     
==========================================
  Files         587      599      +12     
  Lines       27610    28506     +896     
  Branches     2045     2124      +79     
==========================================
+ Hits        20671    21483     +812     
- Misses       6360     6395      +35     
- Partials      579      628      +49     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@conbrad conbrad marked this pull request as ready for review December 18, 2025 20:57
@conbrad conbrad requested review from brettedw and dgboss December 18, 2025 23:27
Co-authored-by: dgboss <darren.boss@gov.bc.ca>
@conbrad conbrad requested a review from dgboss December 31, 2025 20:02
def generate_web_optimized_cog(
input_path: str,
output_path: str,
target_srs: str = "EPSG:3857",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EPSG:3857 seems to be hard coded in a couple/few places. What do you think about creating a constant for it in geospatial.py?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in: 16d2983

@conbrad conbrad requested a review from dgboss December 31, 2025 21:12
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants