WFP-VAM / prism-app

PRISM is an interactive map-based dashboard that simplifies the integration of geospatial data on hazards, along with information on socioeconomic vulnerability
MIT License
49 stars 34 forks source link

[Feature Request]: Fetch 'chart' data when loading a map layer with a chart configuration and display it in the tooltip #1150

Open wadhwamatic opened 8 months ago

wadhwamatic commented 8 months ago

Provide a clear and concise description of what you want to happen.

Since we have pre-extracted admin level data for a few layers (HDC stats api used for charts), we could start displaying that information to users without having to run an analysis. This just an idea for exploration now, but I would like to know how easy it would be to make the stats api call to retrieve admin level data for a layer, and then display the mean value in the tooltip when a user clicks on a layer.

Editing to add more details: When layers provided through HDC (https://api.earthobservation.vam.wfp.org/ows/) have a chart_data configuration, we can access statistics for each administrative area via the HDC stats API (https://api.earthobservation.vam.wfp.org/stats/admin). In those cases, it's beneficial for users to be able to access these statistics without having to run an analysis.

We should look into:

  1. Adding a parallel request to the stats api when an HDC layer with chart_data is loaded
  2. Adding the received statistics as attributes to the underlying boundary file / polygons while that layer is active
  3. Displaying the statistics in the tooltip
  4. Adding new statistics to the boundary file / polygons whenever a new layer is loaded / or new date requested

Is there anything else you can add about the proposal? You might want to link to related issues here, if you haven't already.

No response

wadhwamatic commented 5 months ago

@gislawill - I'll add more details here when I get a minute