GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
raster/put_row.c File Reference

Raster library - Put raster row. More...

#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <grass/config.h>
#include <grass/raster.h>
#include <grass/glocale.h>
#include "R.h"
Include dependency graph for raster/put_row.c:

Go to the source code of this file.

Functions

void Rast_put_row (int fd, const void *buf, RASTER_MAP_TYPE data_type)
 Writes the next row for cell/fcell/dcell file. More...
 
void Rast_put_c_row (int fd, const CELL *buf)
 Writes the next row for cell file (CELL version) More...
 
void Rast_put_f_row (int fd, const FCELL *buf)
 Writes the next row for fcell file (FCELL version) More...
 
void Rast_put_d_row (int fd, const DCELL *buf)
 Writes the next row for dcell file (DCELL version) More...
 
void Rast__write_null_bits (int fd, const unsigned char *flags)
 Write null data. More...
 

Detailed Description

Raster library - Put raster row.

(C) 2003-2009 by the 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.

Author
Original author CERL

Definition in file raster/put_row.c.

Function Documentation

◆ Rast__write_null_bits()

void Rast__write_null_bits ( int  fd,
const unsigned char *  flags 
)

Write null data.

Parameters
flags?
rowrow number
colcol number
fdfile descriptor of cell data file
Returns
void

Definition at line 543 of file raster/put_row.c.

References fileinfo::cellhd, Cell_head::cols, R__::fileinfo, fileinfo::null_cur_row, fileinfo::null_row_ptr, and Rast__null_bitstream_size().

◆ Rast_put_c_row()

void Rast_put_c_row ( int  fd,
const CELL buf 
)

Writes the next row for cell file (CELL version)

See Rast_put_row() for details.

Parameters
fdfile descriptor where data is to be written
bufbuffer holding data
Returns
void

Definition at line 80 of file raster/put_row.c.

References CELL_TYPE, and Rast_put_row().

◆ Rast_put_d_row()

void Rast_put_d_row ( int  fd,
const DCELL buf 
)

Writes the next row for dcell file (DCELL version)

See Rast_put_row() for details.

Parameters
fdfile descriptor where data is to be written
bufbuffer holding data
Returns
void

Definition at line 110 of file raster/put_row.c.

References DCELL_TYPE, and Rast_put_row().

◆ Rast_put_f_row()

void Rast_put_f_row ( int  fd,
const FCELL buf 
)

Writes the next row for fcell file (FCELL version)

See Rast_put_row() for details.

Parameters
fdfile descriptor where data is to be written
bufbuffer holding data
Returns
void

Definition at line 95 of file raster/put_row.c.

References FCELL_TYPE, and Rast_put_row().

◆ Rast_put_row()

void Rast_put_row ( int  fd,
const void *  buf,
RASTER_MAP_TYPE  data_type 
)

Writes the next row for cell/fcell/dcell file.

Writes the next row for the cell file opened on 'fd' from 'buf' All writes go into NEW files that exactly match the current window. The file must have been opened with Rast_open_new() and be written sequentially, ie no skipping rows.

When the null values are embedded into the data, corresponding cells are changed to 0's and the corresponding null value row is written into null file.

A map cannot be copied using Rast_get_row() and Rast_put_row(). The former resamples the data of the original map into a row buffer that matches the current window. The later writes out rows associated with the window.

Keeps track of the minimum and maximum cell value for use in updating the range file upon close of the cell file. HOWEVER when nulls are not embedded, the cells are considered 0's as far as updating range is concerned, even if the corresponding cell is null in the resulting null file, so programmer should be carefult to set all the null values using Rast_set_null_value() or G_insert_d_null_values() or G_insert_f_null_values().

Parameters
fdfile descriptor where data is to be written
bufbuffer holding data
data_typeraster map type (CELL_TYPE, FCELL_TYPE, DCELL_TYPE)
Returns
void

Definition at line 65 of file raster/put_row.c.

Referenced by Rast_put_c_row(), Rast_put_d_row(), and Rast_put_f_row().