Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

The map needed to (1) ingest Mosquito Alert reports and show them on the map, and (2) allow date-range selection with risk aggregation, showing all reports for the selected species and range.

  • Date-range UI: Replaced single-date picker with start/end controls; kept transparency and layer toggles intact.
  • Risk aggregation (Spain/Barcelona): Aggregate municipal predictions and GeoTIFF rasters across the chosen range, rendering mean values per pixel/municipality.
  • Observations overlay: Fetch nightly Mosquito Alert observations, filter by species and date range, and render lightweight circle markers (Leaflet/Mapbox), with layer toggle support.
  • Data loading hardening: Added observation loader, parallel fetch for Spain predictions, GeoTIFF averaging helper, safer raster checks, and cache reuse.

Example (Spain aggregation loop, simplified):

const dates = buildDateArray(range);
const responses = await Promise.allSettled(
  dates.map(d => fetch(config.baseUrl + config.filePattern.replace('{date}', d)))
);
const aggregated = aggregateByMunicipality(responses);
mapManager.setObservationsData(observationsGeoJSON);

https://github.com/user-attachments/assets/d41bc41b-7c28-4be0-943f-21507e283ff2

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.mosquitoalert.com
    • Triggering command: /usr/bin/python python - (dns block)
  • https://api.github.com/repos/Mosquito-Alert/map/contents
    • Triggering command: /usr/bin/python python - (http block)
  • https://api.github.com/repos/Mosquito-Alert/map_backend/contents
    • Triggering command: /usr/bin/python python - (http block)
  • https://api.github.com/repos/mosquitoalert/data/contents
    • Triggering command: /usr/bin/python python - (http block)
  • https://api.github.com/repos/mosquitoalert/data/releases/latest
    • Triggering command: /usr/bin/python python - (http block)
  • map.mosquitoalert.com
    • Triggering command: /usr/bin/python python - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Please try to do the following, if possible (if not possible, then tell me the main obstacles):

  1. Add mosquito alert reports (observations) to the maps. Inspect the html and js code at https://map.mosquitoalert.com and figure out how this map is loading the mosquito data it displays. Use this information to grab all reports of the selected species for the selected date and display them on the map. Do not include popups for each report - just mark it on the map in the most efficient and clear way possible (e.g. a circle that contrasts will with the background).

  2. Make it possible for user to select a date range instead of an individual date. Take all estimates for that data range and aggregate them, calculating the mean value for the date range at each point/pixel.

  3. If you are able to implement 1 and 2, then when user selects a date range, display all reports of the given species from that date range.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: JohnPalmer <623626+JohnPalmer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add mosquito alert reports to the maps and enable date range selection Add mosquito-alert date-range aggregation and observation overlays Dec 30, 2025
Copilot AI requested a review from JohnPalmer December 30, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants