[x] integrate into demo portal (basic functionality)
[ ] move into separate library for reusability
[x] support datasets in arbitrary projections
Implementation plan:
This applies to CoverageJSON grid coverages which have a single categorical parameter.
The user is given the choice which of the time steps (reference periods) of the coverage should be included in the statistics.
For each time step, the number of grid cells belonging to each category are counted.
For each time step, a total count is calculated from the sum of the category counts.
For each time step and category, a ratio is calculated by dividing category count by total count.
The resulting statistical data is serialized as a CoverageJSON coverage with a single dimension "time" and a parameter for each category ("Category X ratio"). The observedProperty of each parameter has "statisticalMeasure": "http://www.uncertml.org/statistics/discrete-probability" and "statisticalCategories": [...] where the latter is a 1-element array of the original category over which the statistic runs.
Efficiency is achieved by loading each time step separately (by subsetting) and creating the individual statistics for that step and later merging all together. This avoids high memory usage.
The statistical CoverageJSON coverage is stored as a separate dataset which then has a button for viewing the data using charts.
Note on accuracy:
The ratios are calculated by counting the grid cells of the original coverage. No reprojection takes place currently, meaning that the resulting statistics are only accurate if the input dataset uses equal-area grid cells.
Description: Wiki
Libraries to be used:
Tasks to be finished:
Implementation plan:
observedProperty
of each parameter has"statisticalMeasure": "http://www.uncertml.org/statistics/discrete-probability"
and"statisticalCategories": [...]
where the latter is a 1-element array of the original category over which the statistic runs.Note on accuracy: The ratios are calculated by counting the grid cells of the original coverage. No reprojection takes place currently, meaning that the resulting statistics are only accurate if the input dataset uses equal-area grid cells.