GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
Loading...
Searching...
No Matches
c_count.c
Go to the documentation of this file.
1#include <grass/gis.h>
2#include <grass/raster.h>
3
4void c_count(DCELL *result, DCELL *values, int n, const void *closure UNUSED)
5{
6 int count;
7 int i;
8
9 count = 0;
10
11 for (i = 0; i < n; i++)
12 if (!Rast_is_d_null_value(&values[i]))
13 count++;
14
15 *result = count;
16}
17
18void w_count(DCELL *result, DCELL (*values)[2], int n,
19 const void *closure UNUSED)
20{
21 DCELL count;
22 int i;
23
24 count = 0.0;
25
26 for (i = 0; i < n; i++)
27 if (!Rast_is_d_null_value(&values[i][0]))
28 count += values[i][1];
29
30 *result = count;
31}
void c_count(DCELL *result, DCELL *values, int n, const void *closure UNUSED)
Definition c_count.c:4
void w_count(DCELL *result, DCELL(*values)[2], int n, const void *closure UNUSED)
Definition c_count.c:18
int count