GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include <grass/config.h>
#include <grass/glocale.h>
#include "G.h"
Go to the source code of this file.
Macros | |
#define | NULL_FILE "null" |
Functions | |
int | G_get_map_row_nomask (int fd, CELL *buf, int row) |
Read raster row without masking (this routine is deprecated) More... | |
int | G_get_raster_row_nomask (int fd, void *buf, int row, RASTER_MAP_TYPE data_type) |
Read raster row without masking. More... | |
int | G_get_c_raster_row_nomask (int fd, CELL *buf, int row) |
Read raster row without masking (CELL type) More... | |
int | G_get_f_raster_row_nomask (int fd, FCELL *buf, int row) |
Read raster row without masking (FCELL type) More... | |
int | G_get_d_raster_row_nomask (int fd, DCELL *buf, int row) |
Read raster row without masking (DCELL type) More... | |
int | G_get_map_row (int fd, CELL *buf, int row) |
Get raster row (this routine is deprecated!) More... | |
int | G_get_raster_row (int fd, void *buf, int row, RASTER_MAP_TYPE data_type) |
Get raster row. More... | |
int | G_get_c_raster_row (int fd, CELL *buf, int row) |
Get raster row (CELL type) More... | |
int | G_get_f_raster_row (int fd, FCELL *buf, int row) |
Get raster row (FCELL type) More... | |
int | G_get_d_raster_row (int fd, DCELL *buf, int row) |
Get raster row (DCELL type) More... | |
int | G_get_null_value_row (int fd, char *flags, int row) |
Read or simmulate null value row. More... | |
#define NULL_FILE "null" |
Definition at line 30 of file gis/get_row.c.
Get raster row (CELL type)
Reads a row of raster data and leaves the NULL values intact. (As opposed to the deprecated function G_get_map_row() which converts NULL values to zero.)
NOTE. When the raster map is old and null file doesn't exist, it is assumed that all 0-cells are no-data. When map is floating point, uses quant rules set explicitly by G_set_quant_rules() or stored in map's quant file to convert floats to integers.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
Definition at line 922 of file gis/get_row.c.
References G_get_raster_row().
Referenced by G_get_null_value_row(), Gs_get_cat_label(), Gs_loadmap_as_char(), Gs_loadmap_as_int(), and Gs_loadmap_as_short().
Read raster row without masking (CELL type)
Same as G_get_c_raster_row() except no masking occurs.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
data_type | data type |
Definition at line 781 of file gis/get_row.c.
References G_get_raster_row_nomask().
Get raster row (DCELL type)
Same as G_get_f_raster_row() except that the array dcell is double
.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
Definition at line 965 of file gis/get_row.c.
References G_get_raster_row().
Referenced by G_get_raster_sample_bilinear(), G_get_raster_sample_cubic(), G_get_raster_sample_nearest(), and Gs_get_cat_label().
Read raster row without masking (DCELL type)
Same as G_get_d_raster_row() except no masking occurs.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
data_type | data type |
Definition at line 821 of file gis/get_row.c.
References G_get_raster_row_nomask().
Get raster row (FCELL type)
Read a row from the raster map open on fd into the float
array fcell performing type conversions as necessary based on the actual storage type of the map. Masking, resampling into the current region. NULL-values are always embedded in fcell
(never converted to a value).
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
Definition at line 945 of file gis/get_row.c.
References G_get_raster_row().
Referenced by Gs_loadmap_as_float().
Read raster row without masking (FCELL type)
Same as G_get_f_raster_row() except no masking occurs.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
data_type | data type |
Definition at line 801 of file gis/get_row.c.
References G_get_raster_row_nomask().
Get raster row (this routine is deprecated!)
If the map is floating-point, quantize the floating-point values to integer using the quantization rules established for the map when the map was opened for reading (this quantization is read from cell_misc/name/f_quant file, but can be reset after opening raster map by G_set_quant_rules()). NULL values are converted to zeros.
This routine is deprecated! Use G_get_raster_row() instead.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
Definition at line 848 of file gis/get_row.c.
Referenced by IL_create_bitmask().
Read raster row without masking (this routine is deprecated)
This routine reads the specified row from the raster map open on file descriptor fd into the buf buffer like G_get_map_row() does. The difference is that masking is suppressed. If the user has a mask set, G_get_map_row() will apply the mask but G_get_map_row_nomask() will ignore it. This routine prints a diagnostic message and returns -1 if there is an error reading the raster map. Otherwise a nonnegative value is returned.
Note. Ignoring the mask is not generally acceptable. Users expect the mask to be applied. However, in some cases ignoring the mask is justified. For example, the GRASS modules r.describe, which reads the raster map directly to report all data values in a raster map, and r.slope.aspect, which produces slope and aspect from elevation, ignore both the mask and the region. However, the number of GRASS modules which do this should be minimal. See Mask for more information about the mask.
This routine is deprecated! Use G_get_raster_row_nomask() instead.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
Definition at line 740 of file gis/get_row.c.
Read or simmulate null value row.
Read or simmulate null value row and set the cells corresponding to null value to 1. The masked out cells are set to null when the mask exists. (the MASK is taken care of by null values (if the null file doesn't exist for this map, then the null row is simulated by assuming that all zeros in raster map are nulls. Also all masked out cells become nulls.
fd | file descriptor for the opened map |
buf | buffer for the row to be placed into |
row | data row desired |
Definition at line 1242 of file gis/get_row.c.
References fd, G__::fileinfo, G_allocate_c_raster_buf(), G_free(), G_get_c_raster_row(), G_is_c_null_value(), fileinfo::reclass_flag, and G__::window.
Referenced by Gs_loadmap_as_bitmap(), Gs_loadmap_as_char(), Gs_loadmap_as_float(), Gs_loadmap_as_int(), and Gs_loadmap_as_short().
Get raster row.
If data_type is
DCELL_TYPE, calls G_get_d_raster_row()
Reads appropriate information into the buffer buf associated with the requested row row. buf is associated with the current window.
Note, that the type of the data in buf (say X) is independent of the type of the data in the file described by fd (say Y).
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
data_type | data type |
Definition at line 895 of file gis/get_row.c.
Referenced by G_get_c_raster_row(), G_get_d_raster_row(), G_get_f_raster_row(), G_get_raster_row_colors(), and N_read_rast_to_array_2d().
Read raster row without masking.
Same as G_get_raster_row() except no masking occurs.
fd | file descriptor for the opened raster map |
buf | buffer for the row to be placed into |
row | data row desired |
data_type | data type |
Definition at line 760 of file gis/get_row.c.
Referenced by G_get_c_raster_row_nomask(), G_get_d_raster_row_nomask(), and G_get_f_raster_row_nomask().