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
48 stars 34 forks source link

[Feature Request]: enhance accuracy of min/max statistics #693

Open DanielJDufour opened 1 year ago

DanielJDufour commented 1 year ago

Provide a clear and concise description of what the problem is.

When fetching raster data for statistical analysis, we submit a WCS GetCoverage request with a height and width given. Limiting the size of the generated GeoTIFF helps protect the server from running out of memory and also ensures a timely response. However, this can lead to inaccuracies when calculating the extreme values (min or max). WCS servers (e.g. GeoServer and Open Data Cube) generally use nearest-neighbor interpolation in order to generate the resampled tiff. If the pixel with the highest or lowest value happens not to be in in the sampled pixels, the the statistical result will be in accurate. The degree of this inaccuracy will depend on how many pixels have these extreme values. For example, weather values are generally distributed smoothly and continuously (without large abrupt changes) and therefore are more resistant to these issues. However, values that depend on landcover could experience larger changes between neighboring pixels and are more susceptible to issues with nearest resampling.

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

Action items could include:

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 1 year ago

Thanks for raising this @DanielJDufour. Another thing to consider is that we recently added STAC support to WFP's Data Cube deployment, which is the primary source for raster data in PRISM. We can now download a GeoTIFF via STAC (see PR https://github.com/WFP-VAM/prism-app/pull/669) but we haven't yet used STAC for stats. I created an issue around this a while ago: https://github.com/WFP-VAM/prism-app/issues/644

Have you worked with STAC? I'm hoping there are methods through the STAC API to address this. Let me know what you think!