3
#include <grass/raster.h>
4
#include <grass/raster3d.h>
5
#include <grass/glocale.h>
6
#include "local_proto.h"
10
* check_stats() - Check and update statistics
12
* RETURN: EXIT_SUCCESS / EXIT_FAILURE
14
int check_stats(const char *name)
16
struct Categories cats;
17
struct FPRange fprange;
20
G_message(_("Updating statistics for <%s>"), name);
22
/* Get category status and max */
23
cats_ok = (Rast3d_read_cats(name, "", &cats) >= 0);
24
Rast3d_read_range(name, "", &fprange);
26
/* Further category checks */
28
Rast_init_cats("", &cats);
29
else if (cats.num != fprange.max) {
30
cats.num = fprange.max;
34
/* Update categories if needed */
36
G_message(_("Updating the number of categories for <%s>"), name);
37
Rast3d_write_cats(name, &cats);
39
Rast_free_cats(&cats);