grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

GRASS Cluster analysis statistics Library

by GRASS Development Team (


This library does a k-means style of cluster analysis. It is currently only used by i.cluster.

The library functions are defined in cluster.h.

#include <grass/cluster.h>

Cluster structure

struct Cluster
int nbands; /* number of bands */
int npoints; /* number of points */
DCELL **points; /* array of points */
int np;
double *band_sum; /* sum over each band */
double *band_sum2; /* sum of squares over each band */
int *class; /* class of each point */
int *reclass; /* for removing empty classes */
int *count; /* number of points in each class */
int *countdiff; /* change in count */
double **sum; /* sum over band per class */
double **sumdiff; /* change in sum */
double **sum2; /* sum of squares per band per class */
double **mean; /* initial class means */
struct Signature S; /* final signature(s) */
int nclasses; /* number of classes */
int merge1, merge2;
int iteration; /* number of iterations */
double percent_stable; /* percentage stable */
double DCELL
Definition: gis.h:604
Definition: cluster.h:8
int iteration
Definition: cluster.h:29
int * count
Definition: cluster.h:19
double percent_stable
Definition: cluster.h:30
double ** sum2
Definition: cluster.h:23
int npoints
Definition: cluster.h:10
int * countdiff
Definition: cluster.h:20
struct Signature S
Definition: cluster.h:25
double * band_sum2
Definition: cluster.h:15
int nclasses
Definition: cluster.h:27
double ** mean
Definition: cluster.h:24
DCELL ** points
Definition: cluster.h:11
int merge2
Definition: cluster.h:28
int * reclass
Definition: cluster.h:18
int np
Definition: cluster.h:12
double * band_sum
Definition: cluster.h:14
int merge1
Definition: cluster.h:28
double ** sum
Definition: cluster.h:21
int nbands
Definition: cluster.h:9
double ** sumdiff
Definition: cluster.h:22

List of functions