GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
iclass.c File Reference

Imagery library - functions for wx.iclass. More...

#include <grass/imagery.h>
#include <grass/glocale.h>
#include <grass/vector.h>
#include "iclass_local_proto.h"
Include dependency graph for iclass.c:

Go to the source code of this file.

Functions

int I_iclass_analysis (IClass_statistics *statistics, struct Ref *refer, struct Map_info *map_info, const char *layer_name, const char *group, const char *raster_name)
 Calculates statistical values for one class and multiple bands based on training areas. More...
 
int I_iclass_init_group (const char *group_name, const char *subgroup_name, struct Ref *refer)
 Read files for the specified group subgroup into the Ref structure. More...
 
void I_iclass_create_raster (IClass_statistics *statistics, struct Ref *refer, const char *raster_name)
 Create raster map based on statistics. More...
 

Detailed Description

Imagery library - functions for wx.iclass.

Computation based on training areas for supervised classification. Based on i.class module (GRASS 6).

Copyright (C) 1999-2007, 2011 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
David Satnik, Central Washington University (original author)
Markus Neteler <neteler itc.it> (i.class module)
Bernhard Reiter <bernhard intevation.de> (i.class module)
Brad Douglas <rez touchofmadness.com>(i.class module)
Glynn Clements <glynn gclements.plus.com> (i.class module)
Hamish Bowman <hamish_b yahoo.com> (i.class module)
Jan-Oliver Wagner <jan intevation.de> (i.class module)
Anna Kratochvilova <kratochanna gmail.com> (rewriting for wx.iclass)
Vaclav Petras <wenzeslaus gmail.com> (rewriting for wx.iclass)

Definition in file iclass.c.

Function Documentation

◆ I_iclass_analysis()

int I_iclass_analysis ( IClass_statistics statistics,
struct Ref refer,
struct Map_info map_info,
const char *  layer_name,
const char *  group,
const char *  raster_name 
)

Calculates statistical values for one class and multiple bands based on training areas.

Calculates values statistical based on the cells that are within training areas. Creates raster map to display the cells of the image bands which fall within standard deviations from the means.

Parameters
statisticspointer to bands statistics
referpointer to band files structure
map_infovector map with training areas
layer_namevector layer
groupname of imagery group
raster_namename of temporary raster map (to be created)
Returns
number of processed training areas
-1 on failure

Definition at line 50 of file iclass.c.

References _, alloc_statistics(), IClass_statistics::cat, close_band_files(), create_raster(), free_perimeters(), G_debug(), G_get_set_window(), G_warning(), make_all_statistics(), Ref::nfiles, open_band_files(), and vector2perimeters().

◆ I_iclass_create_raster()

void I_iclass_create_raster ( IClass_statistics statistics,
struct Ref refer,
const char *  raster_name 
)

Create raster map based on statistics.

Parameters
statisticspointer to bands statistics
referpointer to band files structure
raster_namename of temporary raster map (to be created)

Definition at line 160 of file iclass.c.

References b, band_range(), close_band_files(), create_raster(), IClass_statistics::nbands, and open_band_files().

◆ I_iclass_init_group()

int I_iclass_init_group ( const char *  group_name,
const char *  subgroup_name,
struct Ref refer 
)

Read files for the specified group subgroup into the Ref structure.

Parameters
group_namename of imagery group
subgroup_namename of imagery subgroup
subgroup_nameif it is NULL, bands from group will be used
[out]referpointer to band files structure
Returns
1 on success
0 on failure

Definition at line 105 of file iclass.c.

References _, Ref::file, G_debug(), G_find_raster(), G_warning(), I_free_group_ref(), I_get_group_ref(), I_get_subgroup_ref(), I_init_group_ref(), Ref_Files::mapset, Ref_Files::name, Ref::nfiles, and NULL.