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};
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);
178 CU_ASSERT(
raster != NULL);
180 CU_ASSERT(
band != NULL);
183 for (
x = 0;
x < xmax;
x++) {
184 for (
y = 0;
y < ymax;
y++) {
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);
struct rt_quantile_t * rt_quantile
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
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.
struct rt_bandstats_t * rt_bandstats
int quantile_llist_destroy(struct quantile_llist **list, uint32_t list_count)
rt_errorstate rt_band_set_nodata(rt_band band, double val, int *converted)
Set nodata value.
rt_errorstate rt_band_set_pixel(rt_band band, int x, int y, double val, int *converted)
Set single pixel's value.
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
rt_histogram rt_band_get_histogram(rt_bandstats stats, uint32_t bin_count, double *bin_widths, uint32_t bin_widths_count, int right, double min, double max, uint32_t *rtn_count)
Count the distribution of data.
void rtdealloc(void *mem)
rt_quantile rt_band_get_quantiles(rt_bandstats stats, double *quantiles, int quantiles_count, uint32_t *rtn_count)
Compute the default set of or requested quantiles for a set of data the quantile formula used is same...
rt_bandstats rt_band_get_summary_stats(rt_band band, int exclude_nodata_value, double sample, int inc_vals, uint64_t *cK, double *cM, double *cQ)
Compute summary statistics for a band.
struct rt_histogram_t * rt_histogram
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
rt_band cu_add_band(rt_raster raster, rt_pixtype pixtype, int hasnodata, double nodataval)
void cu_free_raster(rt_raster raster)