GRASS 8 Programmer's Manual
8.6.0dev(2026)-5f4f7ad06c
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
4
void
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
18
void
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
}
Rast_is_d_null_value
#define Rast_is_d_null_value(dcellVal)
Definition
defs/raster.h:417
c_count
stat_func c_count
w_count
stat_func_w w_count
gis.h
DCELL
double DCELL
Definition
gis.h:635
UNUSED
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
Definition
gis.h:46
count
int count
raster.h
lib
stats
c_count.c
Generated on Sat Apr 4 2026 07:00:49 for GRASS 8 Programmer's Manual by
1.9.8