GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
Raster Library - NULL value management. More...
Go to the source code of this file.
Functions | |
void | Rast__set_null_value (void *rast, int numVals, int null_is_zero, RASTER_MAP_TYPE data_type) |
To set one or more raster values to null. More... | |
void | Rast_set_null_value (void *buf, int numVals, RASTER_MAP_TYPE data_type) |
To set one or more raster values to null. More... | |
void | Rast_set_c_null_value (CELL *cellVals, int numVals) |
To set a number of CELL raster values to NULL. More... | |
void | Rast_set_f_null_value (FCELL *fcellVals, int numVals) |
To set a number of FCELL raster values to NULL. More... | |
void | Rast_set_d_null_value (DCELL *dcellVals, int numVals) |
To set a number of DCELL raster values to NULL. More... | |
int | Rast_is_null_value (const void *rast, RASTER_MAP_TYPE data_type) |
To check if a raster value is set to NULL. More... | |
void | Rast_insert_null_values (void *rast, char *null_row, int ncols, RASTER_MAP_TYPE data_type) |
To check if a CELL raster value is set to NULL. More... | |
void | Rast_insert_c_null_values (CELL *cellVal, char *null_row, int ncols) |
To insert null values into an integer raster map (CELL) More... | |
void | Rast_insert_f_null_values (FCELL *fcellVal, char *null_row, int ncols) |
To insert null values into an floating-point raster map (FCELL) More... | |
void | Rast_insert_d_null_values (DCELL *dcellVal, char *null_row, int ncols) |
To insert null values into an floating-point raster map (FCELL) More... | |
int | Rast__check_null_bit (const unsigned char *flags, int bit_num, int n) |
Check NULL. More... | |
int | G__set_flags_from_01_random (const char *zero_ones, unsigned char *flags, int col, int n, int ncols) |
Given array of 0/1 of length n starting from column. More... | |
void | Rast__convert_01_flags (const char *zero_ones, unsigned char *flags, int n) |
? More... | |
void | Rast__convert_flags_01 (char *zero_ones, const unsigned char *flags, int n) |
? More... | |
void | Rast__init_null_bits (unsigned char *flags, int cols) |
? More... | |
Raster Library - NULL value management.
To provide functionality to handle NULL values for data types CELL, FCELL, and DCELL. May need more...
(C) 2001-2009 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.
Definition in file null_val.c.
int G__set_flags_from_01_random | ( | const char * | zero_ones, |
unsigned char * | flags, | ||
int | col, | ||
int | n, | ||
int | ncols | ||
) |
Given array of 0/1 of length n starting from column.
Note: Only for internal use.
Given array of 0/1 of length n starting from column set the corresponding bits of flags; total number of bits in flags is ncols.
zero_ones | |
flags | |
col | |
n | |
ncols |
Definition at line 374 of file null_val.c.
References count, Rast__check_null_bit(), Rast__convert_01_flags(), and Rast__null_bitstream_size().
int Rast__check_null_bit | ( | const unsigned char * | flags, |
int | bit_num, | ||
int | n | ||
) |
Check NULL.
Note: Only for internal use.
flags | null bitmap |
bit_num | index of bit to check |
n | size of null bitmap (in bits) |
Definition at line 338 of file null_val.c.
References G_fatal_error().
Referenced by G__set_flags_from_01_random().
void Rast__convert_01_flags | ( | const char * | zero_ones, |
unsigned char * | flags, | ||
int | n | ||
) |
?
Note: Only for internal use.
zero_ones | |
flags | |
n |
Definition at line 423 of file null_val.c.
References count, and Rast__null_bitstream_size().
Referenced by G__set_flags_from_01_random().
void Rast__convert_flags_01 | ( | char * | zero_ones, |
const unsigned char * | flags, | ||
int | n | ||
) |
?
Note: Only for internal use.
zero_ones | |
flags | |
n |
Definition at line 461 of file null_val.c.
References count, and Rast__null_bitstream_size().
void Rast__init_null_bits | ( | unsigned char * | flags, |
int | cols | ||
) |
?
Note: Only for internal use.
flags | |
cols |
Definition at line 495 of file null_val.c.
References Rast__null_bitstream_size().
void Rast__set_null_value | ( | void * | rast, |
int | numVals, | ||
int | null_is_zero, | ||
RASTER_MAP_TYPE | data_type | ||
) |
To set one or more raster values to null.
It also sets null to zero if null_is_zero is TRUE.
rast | pointer to values to set to null |
numVals | number of values to set to null |
null_is_zero | flag to indicate if NULL = 0 |
data_type | type of raster - CELL, FCELL, DCELL |
Definition at line 80 of file null_val.c.
References G_zero(), Rast_cell_size(), and Rast_set_null_value().
void Rast_insert_c_null_values | ( | CELL * | cellVal, |
char * | null_row, | ||
int | ncols | ||
) |
To insert null values into an integer raster map (CELL)
For each of the count flags which is true(!=0), set the corresponding cell to the NULL value.
rast | pointer raster values |
null_row | null row |
ncols | number of columns |
Definition at line 295 of file null_val.c.
void Rast_insert_d_null_values | ( | DCELL * | dcellVal, |
char * | null_row, | ||
int | ncols | ||
) |
To insert null values into an floating-point raster map (FCELL)
For each for the count flag which is true(!=0), set the corresponding dcell to the NULL value.
dcellVal | pointer raster values |
null_row | null row |
ncols | number of columns |
Definition at line 322 of file null_val.c.
void Rast_insert_f_null_values | ( | FCELL * | fcellVal, |
char * | null_row, | ||
int | ncols | ||
) |
To insert null values into an floating-point raster map (FCELL)
fcellVal | pointer raster values |
null_row | null row |
ncols | number of columns |
Definition at line 307 of file null_val.c.
void Rast_insert_null_values | ( | void * | rast, |
char * | null_row, | ||
int | ncols, | ||
RASTER_MAP_TYPE | data_type | ||
) |
To check if a CELL raster value is set to NULL.
Returns 1 if cell is NULL, 0 otherwise. This will test if the value cell is the largest int
.
cellVal | CELL raster value to check |
To check if a FCELL raster value is set to NULL
Returns 1 if fcell is NULL, 0 otherwise. This will test if the value fcell is a NaN. It isn't good enough to test for a particular NaN bit pattern since the machine code may change this bit pattern to a different NaN. The test will be
or (as suggested by Mark Line)
fcellVal | FCELL raster value to check |
To check if a DCELL raster value is set to NULL
Returns 1 if dcell is NULL, 0 otherwise. This will test if the value dcell is a NaN. Same test as in Rast_is_f_null_value().
dcellVal | DCELL raster value to check |
To insert null values into a map.
rast | pointer raster values |
null_row | null row |
ncols | number of columns |
data_type | type of raster - CELL, FCELL, DCELL |
Definition at line 279 of file null_val.c.
int Rast_is_null_value | ( | const void * | rast, |
RASTER_MAP_TYPE | data_type | ||
) |
To check if a raster value is set to NULL.
rast | raster value to check |
data_type | type of raster - CELL, FCELL, DCELL |
Definition at line 179 of file null_val.c.
References CELL_TYPE, DCELL_TYPE, FALSE, FCELL_TYPE, G_warning(), Rast_is_c_null_value, Rast_is_d_null_value, and Rast_is_f_null_value.
Referenced by Rast_get_f_value(), Rast_get_vrt_row(), Rast_map_to_img_str(), Rast_raster_cmp(), and Rast_row_update_fp_range().
void Rast_set_c_null_value | ( | CELL * | cellVals, |
int | numVals | ||
) |
To set a number of CELL raster values to NULL.
cellVals | pointer to CELL values to set to null |
numVals | number of values to set to null |
Definition at line 124 of file null_val.c.
Referenced by N_copy_array_2d(), Rast_fpreclass_perform_di(), Rast_fpreclass_perform_fi(), Rast_fpreclass_perform_ii(), Rast_get_range_min_max(), Rast_init_range(), Rast_quant_get_limits(), Rast_quant_perform_d(), Rast_quant_perform_f(), and Rast_set_null_value().
void Rast_set_d_null_value | ( | DCELL * | dcellVals, |
int | numVals | ||
) |
To set a number of DCELL raster values to NULL.
dcellVals | pointer to DCELL values to set to null |
numVals | number of values to set to null |
Definition at line 155 of file null_val.c.
Referenced by c_ave(), c_intr(), c_kurt(), c_max(), c_maxx(), c_median(), c_min(), c_minx(), c_quant(), c_range(), c_skew(), c_stddev(), c_sum(), c_var(), N_copy_array_2d(), Rast_fpreclass_perform_dd(), Rast_fpreclass_perform_fd(), Rast_fpreclass_perform_id(), Rast_get_fp_range_min_max(), Rast_get_ith_d_cat(), Rast_init_fp_range(), Rast_quant_get_limits(), Rast_set_null_value(), w_ave(), w_kurt(), w_max(), w_median(), w_min(), w_quant(), w_skew(), w_stddev(), w_sum(), and w_var().
void Rast_set_f_null_value | ( | FCELL * | fcellVals, |
int | numVals | ||
) |
To set a number of FCELL raster values to NULL.
fcellVals | pointer to FCELL values to set to null |
numVals | number of values to set to null |
Definition at line 138 of file null_val.c.
Referenced by N_copy_array_2d(), Rast_fpreclass_perform_df(), Rast_fpreclass_perform_ff(), Rast_fpreclass_perform_if(), Rast_get_f_value(), and Rast_set_null_value().
void Rast_set_null_value | ( | void * | buf, |
int | numVals, | ||
RASTER_MAP_TYPE | data_type | ||
) |
To set one or more raster values to null.
buf | pointer to values to set to null |
numVals | number of values to set to null |
data_type | type of raster - CELL, FCELL, DCELL |
Definition at line 98 of file null_val.c.
References _, CELL_TYPE, DCELL_TYPE, FCELL_TYPE, G_warning(), Rast_set_c_null_value(), Rast_set_d_null_value(), and Rast_set_f_null_value().
Referenced by Rast__set_null_value(), Rast_get_vrt_row(), and Rast_set_f_value().