GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
Go to the source code of this file.
Functions | |
N_array_2d * | N_read_rast_to_array_2d (char *name, N_array_2d *array) |
Read a raster map into a N_array_2d structure. More... | |
void | N_write_array_2d_to_rast (N_array_2d *array, char *name) |
Write a N_array_2d struct to a raster map. More... | |
N_array_3d * | N_read_rast3d_to_array_3d (char *name, N_array_3d *array, int mask) |
Read a volume map into a N_array_3d structure. More... | |
void | N_write_array_3d_to_rast3d (N_array_3d *array, char *name, int mask) |
Write a N_array_3d struct to a volume map. More... | |
N_array_3d* N_read_rast3d_to_array_3d | ( | char * | name, |
N_array_3d * | array, | ||
int | mask | ||
) |
Read a volume map into a N_array_3d structure.
The volume map is opened in the current region settings. If no N_array_3d structure is provided (NULL pointer), a new structure will be allocated with the same data type as the volume map and the size of the current region. The array offset will be set to 0.
If a N_array_3d structure is provided, the values from the volume map are casted to the N_array_3d type. The array must have the same size as the current region.
The new created or the provided array is returned. If the reading of the volume map fails, Rast3d_fatal_error() will be invoked.
name | * char - the name of an existing volume map |
array | * N_array_3d - an existing array or NULL |
mask | int - 0 = false, 1 = true : if a mask is presenent, use it with the input volume map |
Definition at line 249 of file n_arrays_io.c.
References Cell_head::cols, Cell_head::depths, NULL, Cell_head::rows, and x.
N_array_2d* N_read_rast_to_array_2d | ( | char * | name, |
N_array_2d * | array | ||
) |
Read a raster map into a N_array_2d structure.
The raster map will be opened in the current region settings. If no N_array_2d structure is provided (NULL pointer), a new structure will be allocated with the same data type as the raster map and the size of the current region. The array offset will be set to 0.
If a N_array_2d structure is provided, the values from the raster map are casted to the N_array_2d type. The array must have the same size as the current region.
The new created or the provided array are returned. If the reading of the raster map fails, G_fatal_error() will be invoked.
name | * char - the name of an existing raster map |
array | * N_array_2d - an existing array or NULL |
Definition at line 44 of file n_arrays_io.c.
References x.
void N_write_array_2d_to_rast | ( | N_array_2d * | array, |
char * | name | ||
) |
Write a N_array_2d struct to a raster map.
A new raster map is created with the same type as the N_array_2d. The current region is used to open the raster map. The N_array_2d must have the same size as the current region. If the writing of the raster map fails, G_fatal_error() will be invoked.
array | N_array_2d * |
name | char * - the name of the raster map |
Definition at line 171 of file n_arrays_io.c.
References Cell_head::cols, Cell_head::rows, and x.
void N_write_array_3d_to_rast3d | ( | N_array_3d * | array, |
char * | name, | ||
int | mask | ||
) |
Write a N_array_3d struct to a volume map.
A new volume map is created with the same type as the N_array_3d. The current region is used to open the volume map. The N_array_3d must have the same size as the current region. If the writing of the volume map fails, Rast3d_fatal_error() will be invoked.
array | N_array_3d * |
name | char * - the name of the volume map |
mask | int - 1 = use a 3d mask, 0 do not use a 3d mask |
Definition at line 377 of file n_arrays_io.c.
References Cell_head::cols, Cell_head::depths, NULL, Cell_head::rows, and x.