2 #include <grass/glocale.h>
73 sprintf(buf,
"G_truncate_fp_map: can't write quant rules for map %s",
90 sprintf(buf,
"G_truncate_fp_map: can't write quant rules for map %s",
118 struct FPRange fp_range;
121 sprintf(buf,
"G_quantize_fp_map: can't read fp range for map %s",
128 sprintf(buf,
"G_quantize_fp_map: raster map %s is empty", name);
160 DCELL d_min, DCELL d_max, CELL
min, CELL
max)
170 "G_quantize_fp_map_range: can't write quant rules for map %s",
199 const struct Quant *quant)
201 CELL cell_min, cell_max;
206 sprintf(buf, _(
"Cannot write quant rules: map %s is integer"), name);
215 sprintf(buf, _(
"Cannot write quant rules for map %s"), name);
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int G_truncate_fp_map(const char *name, const char *mapset)
int G_quantize_fp_map(const char *name, const char *mapset, CELL min, CELL max)
Writes the f_quant file for the raster map name with one rule. The rule is generated using the floati...
int G_read_quant(const char *name, const char *mapset, struct Quant *quant)
reads quantization rules for "name" in "mapset" and stores them in the quantization structure "quant"...
int G_round_fp_map(const char *name, const char *mapset)
int G__quant_import(const char *name, const char *mapset, struct Quant *quant)
int G_is_d_null_value(const DCELL *dcellVal)
Returns 1 if dcell is NULL, 0 otherwise. This will test if the value dcell is a NaN. Same test as in G_is_f_null_value().
int G_quant_get_limits(const struct Quant *q, DCELL *dMin, DCELL *dMax, CELL *cMin, CELL *cMax)
Extracts the minimum and maximum floating-point and integer values from all the rules (except the "in...
int G__quant_export(const char *name, const char *mapset, const struct Quant *quant)
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
void G_quant_add_rule(struct Quant *q, DCELL dLow, DCELL dHigh, CELL cLow, CELL cHigh)
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
int G_get_fp_range_min_max(const struct FPRange *range, DCELL *min, DCELL *max)
Extract the min/max from the range structure r. If the range structure has no defined min/max (first!...
int G_quant_init(struct Quant *quant)
Initializes the q struct.
int G_read_fp_range(const char *name, const char *mapset, struct FPRange *drange)
Read the floating point range file f_range. This file is written in binary using XDR format...
RASTER_MAP_TYPE G_raster_map_type(const char *name, const char *mapset)
Determine raster data type.
int G_quantize_fp_map_range(const char *name, const char *mapset, DCELL d_min, DCELL d_max, CELL min, CELL max)
Writes the f_quant file for the raster map name with one rule. The rule is generated using the floati...
int G_write_quant(const char *name, const char *mapset, const struct Quant *quant)
Writes the f_quant file for the raster map name from q. if mapset==G_mapset() i.e. the map is in current mapset, then the original quant file in cell_misc/map/f_quant is written. Otherwise q is written into quant2/mapset/name (much like colr2 element). This results in map being read using quant rules stored in q from G_mapset(). See G_read_quant() for detailes.
int G_quant_round(struct Quant *quant)
int G_quant_truncate(struct Quant *quant)
sets the quant for q rules to perform simple truncation on floats.