Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: aggregate CDI results by admin area and make available for download #1337

Open
wadhwamatic opened this issue Sep 10, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request triage to be triaged for next action

Comments

@wadhwamatic
Copy link
Member

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

Users have requested access to CDI data aggregated by admin areas. I believe that hip-analysis already supports this (see zonal stats in https://github.com/WFP-VAM/hip-analysis/blob/dev/hip/analysis/analyses/drought.py) but PRISM hasn't made use of this capability as of yet.

A few things to consider:

  1. Can hip-service / hip-analysis use the zones used in PRISM without issue?
  2. I believe this would warrant a separate layer for admin-level CDI so that users can choose between point-estimate CDI or admin-level CDI in the layer navigation panel
  3. We would need to add configuration of an admin-level CDI layer in layers.json
  4. Should we add a new layer sub-type - composite_aggregate?

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 wadhwamatic added enhancement New feature or request triage to be triaged for next action labels Sep 10, 2024
@wadhwamatic
Copy link
Member Author

wadhwamatic commented Sep 10, 2024

would like to hear your thoughts on the layer type question (point 4 in the description) @ericboucher

@ericboucher
Copy link
Collaborator

ericboucher commented Sep 11, 2024

I believe we could keep the same layer type but add a config flag.

It might be worth thinking about a specific tab design for the composite layers so that we don't have to duplicate the layer in the table? Maybe a toggle or something like that could be sufficient?

@gislawill
Copy link
Collaborator

@ericboucher do you have any maxims you use to determine when to define a new layer type vs when to add to an existing layer type?

We're facing a similar question in #1332 in which we need to add a collection of geojson polygons to the map. It's technically straightforward but determining how it fits into our layer taxonomy is less so.

@gislawill
Copy link
Collaborator

Based on my reading of hip/analysis/analyses/drought.py, I don't believe that zonal stats are already supported by q_multi. We could update our hip-service endpoint to perform the zonal stats and return admin level data instead of point level data.

Alternatively, what would you think about handling this in the Analysis panel? Currently, only raster types and polygons are support but we could add support for point data like these? I believe that would better match our current approach to running zonal stats based on admin level.

@wadhwamatic
Copy link
Member Author

Thanks for looking into it @gislawill. I had thought about using the analysis panel for this. It's a departure from how that is currently built though as it introduces a hazard layer which needs to be computed first. I think it might be simpler to have a separate layer instead, but it would be good to understand which would be easier to maintain.

@gislawill
Copy link
Collaborator

gislawill commented Sep 11, 2024

My understanding of the analysis panel is still somewhat limited so I'm not sure I understand the difference between a "hazard layer" and any other layer we have in PRISM?

The two options I see are:

  1. Optionally run zonal stats in hip-service for q_multi requests
  2. Run zonal stats in PRISM API for composite layers

I lean towards the second option for a couple reasons:

  • It's new functionality that would be usable by any point layers
    • a comment in the code notes that we should add that eventually
    • compared to option 1 which would only be reusable for other q_multi layers
  • It's not building upon hip-service
    • which Valentin wants to move away from

I think one of the most important factors though is the UX that Jordan users would find intuitive. If going through the analysis panel would make it less useful for them, we can create a new layer and add this functionality into hip-service

@gislawill
Copy link
Collaborator

Following up based on Slack conversation with @wadhwamatic:

  • We're going to build this aggregation functionality into hip-service under a new endpoint
    • We're hesitant to do so because we know hip-service's days are limited but it's the best option today
  • The alternative would be to use PRISM python API to do this aggregation via the analysis tab
    • But requiring users to navigate through the analysis tab every time is a poor user experience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage to be triaged for next action
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants