get_row.c File Reference

#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
#include "config.h"
#include "glocale.h"
#include "G.h"

Include dependency graph for get_row.c:

Go to the source code of this file.

Defines

#define NULL_FILE   "null"

Functions

int G_get_map_row_nomask (int fd, CELL *buf, int row)
 read a raster file (without masking)
int G_get_raster_row_nomask (int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
 Same as G_get_f_raster_row() except no masking occurs.
int G_get_c_raster_row_nomask (int fd, CELL *buf, int row)
 Same as G_get_c_raster_row() except no masking occurs.
int G_get_f_raster_row_nomask (int fd, FCELL *buf, int row)
 Same as G_get_f_raster_row() except no masking occurs.
int G_get_d_raster_row_nomask (int fd, DCELL *buf, int row)
 Same as G_get_d_raster_row() except no masking occurs.
int G_get_map_row (int fd, CELL *buf, int row)
 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!!.
int G_get_raster_row (int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
 If data_type is CELL_TYPE, calls G_get_c_raster_row(fd, (CELL *) rast, row); If data_type is FCELL_TYPE, calls G_get_f_raster_row(fd, (FCELL *) rast, row); If data_type is DCELL_TYPE, calls G_get_d_raster_row(fd, (DCELL *) rast, row);.
int G_get_c_raster_row (int fd, CELL *buf, int row)
 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.
int G_get_f_raster_row (int fd, FCELL *buf, int row)
 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).
int G_get_d_raster_row (int fd, DCELL *buf, int row)
 Same as G_get_f_raster_row() except that the array dcell is double.
int G_get_null_value_row (int fd, char *flags, int row)


Define Documentation

#define NULL_FILE   "null"

Definition at line 93 of file get_row.c.


Function Documentation

int G_get_c_raster_row ( int  fd,
CELL *  buf,
int  row 
)

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.

Parameters:
fd 
buf 
row 
Returns:
int

Definition at line 809 of file get_row.c.

References G_get_raster_row().

int G_get_c_raster_row_nomask ( int  fd,
CELL *  buf,
int  row 
)

Same as G_get_c_raster_row() except no masking occurs.

Parameters:
fd 
buf 
row 
Returns:
int

Definition at line 713 of file get_row.c.

References G_get_raster_row_nomask().

int G_get_d_raster_row ( int  fd,
DCELL *  buf,
int  row 
)

Same as G_get_f_raster_row() except that the array dcell is double.

Parameters:
fd 
dcell 
row 
Returns:
int

Definition at line 846 of file get_row.c.

References G_get_raster_row().

int G_get_d_raster_row_nomask ( int  fd,
DCELL *  buf,
int  row 
)

Same as G_get_d_raster_row() except no masking occurs.

Parameters:
fd 
dcell 
row 
Returns:
int

Definition at line 745 of file get_row.c.

References G_get_raster_row_nomask().

int G_get_f_raster_row ( int  fd,
FCELL *  buf,
int  row 
)

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).

Parameters:
fd 
fcell 
row 
Returns:
int

Definition at line 829 of file get_row.c.

References G_get_raster_row().

int G_get_f_raster_row_nomask ( int  fd,
FCELL *  buf,
int  row 
)

Same as G_get_f_raster_row() except no masking occurs.

Parameters:
fd 
fcell 
row 
Returns:
int

Definition at line 729 of file get_row.c.

References G_get_raster_row_nomask().

int G_get_map_row ( int  fd,
CELL *  buf,
int  row 
)

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!!.

Returns:
int

Definition at line 766 of file get_row.c.

int G_get_map_row_nomask ( int  fd,
CELL *  buf,
int  row 
)

read a raster file (without masking)

This routine reads the specified row from the raster file open on file descriptor fd into the cell 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 file. 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 file directly to report all data values in a raster file, 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.

Parameters:
fd 
cell 
row 
Returns:
int

Definition at line 679 of file get_row.c.

int G_get_null_value_row ( int  fd,
char *  flags,
int  row 
)

Definition at line 1089 of file get_row.c.

int G_get_raster_row ( int  fd,
void *  buf,
int  row,
RASTER_MAP_TYPE  data_type 
)

If data_type is CELL_TYPE, calls G_get_c_raster_row(fd, (CELL *) rast, row); If data_type is FCELL_TYPE, calls G_get_f_raster_row(fd, (FCELL *) rast, row); If data_type is DCELL_TYPE, calls G_get_d_raster_row(fd, (DCELL *) rast, row);.

Parameters:
fd 
rast 
row 
data_type 
Returns:
int

Definition at line 786 of file get_row.c.

Referenced by G_get_c_raster_row(), G_get_d_raster_row(), G_get_f_raster_row(), and G_get_raster_row_colors().

int G_get_raster_row_nomask ( int  fd,
void *  buf,
int  row,
RASTER_MAP_TYPE  data_type 
)

Same as G_get_f_raster_row() except no masking occurs.

Parameters:
fd 
fcell 
row 
map_type 
Returns:
int

Definition at line 697 of file get_row.c.

Referenced by G_get_c_raster_row_nomask(), G_get_d_raster_row_nomask(), and G_get_f_raster_row_nomask().


Generated on Mon Jan 1 19:49:33 2007 for GRASS by  doxygen 1.5.1