r.univar: add JSON support
Use parson to add json output format support to the r.univar module.
Expected JSON schema:
At the root is an array, each element of which has the stats for a given zone. The percentile option allows the user to request specific percentiles which are written for each zone object as percentile_%d keys.
[
{
"zone_number": <int>,
"zone_category": <string>,
"n": <int>,
"null_cells": <int>,
"cells": <int>,
"min": <double>,
"max": <double>,
"range": <double>,
"mean": <double>,
"mean_of_abs": <double>,
"stddev": <double>,
"variance": <double>,
"coeff_var": <double>,
"sum": <double>,
"first_quartile": <double>,
"median": <double>,
"third_quartile": <double>,
"percentile_98": <double>
}
]
Can you please compare this schema to what db.univar generates? Maybe they don't need to be the same, but if they are not, we need to have a good reason for that.
@wenzeslaus Can you please point me to the db.univar module, I am unable to find it.
@wenzeslaus Can you please point me to the db.univar module, I am unable to find it.
https://github.com/OSGeo/grass/tree/f13b37931af919be04fa14f392a1f9ea9aa183fd/scripts/db.univar
@cwhite911 updated.