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
45 stars 32 forks source link

Verify that calls to HDC charts are using WFP API Gateway #1139

Closed wadhwamatic closed 2 months ago

wadhwamatic commented 5 months ago

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

I think we might have two different approaches to get chart data from the HDC stats API. It seems that if you use tooltip pathway, we use a get request using the config in layers.json (ex: api.earthobservation.vam.wfp.org/stats) while the charts panel uses the HDC stats api url configuration from the PRISM backend.

We should use the PRISM backend for both cases so that we're using the HDC token.

I tried removing "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", within chart_data for the blended rainfall layers (this config wasn't present in other layers with a chart - only blended). When I remove it, fetching chart data fails both in the tooltip and in the chart panel.

It looks like vam=rfb isn't handled in the PRISM backend. This blended layer query fails: https://prism-api.ovio.org/hdc?level=2&admin_id=1010621&coverage=full&vam=rfb&start=2023-02-11&end=2024-02-11

While this 'non-blended' query works fine: https://prism-api.ovio.org/hdc?level=2&admin_id=1010621&coverage=full&vam=rfh&start=2023-02-11&end=2024-02-11

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

It looks like the issue is that the WFP Gateway doesn't support vam=rfb.

Screenshot 2024-02-26 at 15 50 37

@valpesendorfer - are you planning to add blended data access to the WFP API Gateway?

If that was supported, I think simply removing the url parameter from chart_data in layers.json would work as expected.

valpesendorfer commented 5 months ago

yes the blended data will be added to the API served through the WFP API gateway - probably first in dev and then rolled over to prod.

wadhwamatic commented 2 months ago

No longer needed as the API Gateway approach has changed