30 double bin_width[] = {100};
31 double quantiles[] = {0.1, 0.3, 0.5, 0.7, 0.9};
32 double quantiles2[] = {0.66666667};
45 uint32_t values[] = {0, 91, 55, 86, 76, 41, 36, 97, 25, 63, 68, 2, 78, 15, 82, 47};
50 CU_ASSERT(raster != NULL);
52 CU_ASSERT(band != NULL);
54 for (x = 0; x < xmax; x++) {
55 for (y = 0; y < ymax; y++) {
61 CU_ASSERT_DOUBLE_EQUAL(nodata, 0, DBL_EPSILON);
64 CU_ASSERT(stats != NULL);
65 CU_ASSERT_DOUBLE_EQUAL(stats->
min, 1, DBL_EPSILON);
66 CU_ASSERT_DOUBLE_EQUAL(stats->
max, 198, DBL_EPSILON);
73 CU_ASSERT(histogram != NULL);
77 CU_ASSERT(histogram != NULL);
81 CU_ASSERT(histogram != NULL);
88 CU_ASSERT(stats != NULL);
96 CU_ASSERT_EQUAL(
count, 5);
100 CU_ASSERT(histogram != NULL);
107 CU_ASSERT(stats != NULL);
111 CU_ASSERT(stats != NULL);
115 CU_ASSERT(stats != NULL);
119 CU_ASSERT(stats != NULL);
120 CU_ASSERT_DOUBLE_EQUAL(stats->
min, 0, DBL_EPSILON);
121 CU_ASSERT_DOUBLE_EQUAL(stats->
max, 198, DBL_EPSILON);
131 CU_ASSERT(stats != NULL);
145 CU_ASSERT(raster != NULL);
147 CU_ASSERT(band != NULL);
150 for (x = 0; x < xmax; x++) {
151 for (y = 0; y < ymax; y++) {
157 CU_ASSERT_DOUBLE_EQUAL(nodata, 0, DBL_EPSILON);
165 CU_ASSERT_NOT_EQUAL(
count, 0);
166 CU_ASSERT_NOT_EQUAL(qlls_count, 0);
167 CU_ASSERT_DOUBLE_EQUAL(
quantile[0].value, 78, DBL_EPSILON);
178 CU_ASSERT(raster != NULL);
180 CU_ASSERT(band != NULL);
183 for (x = 0; x < xmax; x++) {
184 for (y = 0; y < ymax; y++) {
185 rt_band_set_pixel(band, x, y, (((
double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
190 CU_ASSERT_DOUBLE_EQUAL(nodata, 0, DBL_EPSILON);
193 for (x = 0; x < max_run; x++) {
195 band, 1, 1, xmax * ymax * max_run,
200 CU_ASSERT_NOT_EQUAL(
count, 0);
201 CU_ASSERT_NOT_EQUAL(qlls_count, 0);
223 double count[] = {3, 4, 5};
226 CU_ASSERT(raster != NULL);
228 CU_ASSERT(band != NULL);
231 for (x = 0; x < xmax; x++) {
232 for (y = 0; y < ymax; y++) {
233 rt_band_set_pixel(band, x, y, (((
double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
237 CU_ASSERT(vcnts != NULL);
238 CU_ASSERT_NOT_EQUAL(rtn, 0);
242 CU_ASSERT(vcnts != NULL);
243 CU_ASSERT_NOT_EQUAL(rtn, 0);
247 CU_ASSERT(vcnts != NULL);
248 CU_ASSERT_NOT_EQUAL(rtn, 0);
252 CU_ASSERT(vcnts != NULL);
253 CU_ASSERT_NOT_EQUAL(rtn, 0);
257 CU_ASSERT(vcnts != NULL);
258 CU_ASSERT_NOT_EQUAL(rtn, 0);
262 CU_ASSERT(vcnts != NULL);
263 CU_ASSERT_NOT_EQUAL(rtn, 0);
rt_quantile rt_band_get_quantiles_stream(rt_band band, int exclude_nodata_value, double sample, uint64_t cov_count, struct quantile_llist **qlls, uint32_t *qlls_count, double *quantiles, uint32_t quantiles_count, uint32_t *rtn_count)
Compute the default set of or requested quantiles for a coverage.