29 #include "iclass_local_proto.h" 51 struct Map_info *map_info,
const char *layer_name,
52 const char *group,
const char *raster_name)
64 IClass_perimeter_list perimeters;
68 G_debug(1,
"iclass_analysis(): group = %s", group);
70 category = statistics->
cat;
83 G_warning(
_(
"No areas in category %d"), category);
115 G_debug(3,
"I_iclass_init_group(): group_name = %s, subgroup_name = %s",
116 group_name, subgroup_name);
124 for (n = 0; n < refer->
nfiles; n++) {
128 "<%s> does not exist"), refer->
file[n].
name,
132 "<%s> does not exist"), refer->
file[n].
name,
143 (
"Subgroup <%s> does not have enough files (it has %d files)"),
144 subgroup_name, refer->
nfiles);
147 (
"Group <%s> does not have enough files (it has %d files)"),
148 group_name, refer->
nfiles);
164 const char *raster_name)
172 for (b = 0; b < statistics->
nbands; b++) {
177 create_raster(statistics, band_buffer, band_fd, raster_name);
void I_iclass_create_raster(IClass_statistics *statistics, struct Ref *refer, const char *raster_name)
Create raster map based on statistics.
2D/3D raster map header (used also for region)
int I_free_group_ref(struct Ref *)
free Ref structure
int vector2perimeters(struct Map_info *Map, const char *layer_name, int category, IClass_perimeter_list *perimeters, struct Cell_head *band_region)
Creates perimeters from vector areas of given category.
void create_raster(IClass_statistics *statistics, CELL **band_buffer, int *band_fd, const char *raster_name)
Create raster map based on statistics.
void alloc_statistics(IClass_statistics *statistics, int nbands)
Allocate space for statistics.
void band_range(IClass_statistics *statistics, int band)
Helper function for computing min and max range in one band.
void free_perimeters(IClass_perimeter_list *perimeters)
Frees all perimeters in list of perimeters.
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.
int make_all_statistics(IClass_statistics *statistics, IClass_perimeter_list *perimeters, CELL **band_buffer, int *band_fd)
Calculate statistics for all training areas.
int I_get_subgroup_ref(const char *, const char *, struct Ref *)
read subgroup REF file
void G_get_set_window(struct Cell_head *)
Get the current working window (region)
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.
const char * G_find_raster(char *, const char *)
Find a raster map.
void G_warning(const char *,...) __attribute__((format(printf
int I_init_group_ref(struct Ref *)
initialize Ref structure
void open_band_files(struct Ref *refer, CELL ***band_buffer, int **band_fd)
Open and allocate space for the group band files.
int I_get_group_ref(const char *, struct Ref *)
read group REF file
int G_debug(int, const char *,...) __attribute__((format(printf
void close_band_files(struct Ref *refer, CELL **band_buffer, int *band_fd)
Close and free space for the group band files.