GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-6c790bf5c0
n_geom.c File Reference
#include <grass/N_pde.h>
Include dependency graph for n_geom.c:

Go to the source code of this file.

Functions

N_geom_dataN_alloc_geom_data (void)
 Allocate the pde geometry data structure and return a pointer to the new allocated structure. More...
 
void N_free_geom_data (N_geom_data *geom)
 Release memory of a pde geometry data structure. More...
 
N_geom_dataN_init_geom_data_3d (RASTER3D_Region *region3d, N_geom_data *geodata)
 Initiate a pde geometry data structure with a 3d region. More...
 
N_geom_dataN_init_geom_data_2d (struct Cell_head *region, N_geom_data *geodata)
 Initiate a pde geometry data structure with a 2d region. More...
 
double N_get_geom_data_area_of_cell (N_geom_data *geom, int row)
 Get the areay size in square meter of one cell (x*y) at row. More...
 

Function Documentation

◆ N_alloc_geom_data()

N_geom_data* N_alloc_geom_data ( void  )

Allocate the pde geometry data structure and return a pointer to the new allocated structure.

Returns
N_geom_data *

Definition at line 29 of file n_geom.c.

References N_geom_data::area, N_geom_data::dim, G_calloc, NULL, and N_geom_data::planimetric.

Referenced by N_init_geom_data_3d().

◆ N_free_geom_data()

void N_free_geom_data ( N_geom_data geom)

Release memory of a pde geometry data structure.

Parameters
geomN_geom_data *
Returns
void

Definition at line 49 of file n_geom.c.

References N_geom_data::area, G_free(), and NULL.

◆ N_get_geom_data_area_of_cell()

double N_get_geom_data_area_of_cell ( N_geom_data geom,
int  row 
)

Get the areay size in square meter of one cell (x*y) at row.

This function works for two and three dimensions

Parameters
geomN_geom_data *
rowint
Returns
area double

Definition at line 196 of file n_geom.c.

References N_geom_data::area, N_geom_data::Az, G_debug(), and N_geom_data::planimetric.

◆ N_init_geom_data_2d()

N_geom_data* N_init_geom_data_2d ( struct Cell_head region,
N_geom_data geodata 
)

Initiate a pde geometry data structure with a 2d region.

If the projection is not planimetric, a double array will be created based on the number of rows of the provided region storing all computed areas for each row

Parameters
regionsruct Cell_head *
geodataN_geom_data * - if a NULL pointer is given, a new structure will be allocatet and returned
Returns
N_geom_data *

Definition at line 117 of file n_geom.c.

Referenced by N_init_geom_data_3d().

◆ N_init_geom_data_3d()

N_geom_data* N_init_geom_data_3d ( RASTER3D_Region region3d,
N_geom_data geodata 
)

Initiate a pde geometry data structure with a 3d region.

If the projection is not planimetric, a double array will be created based on the number of rows of the provided region

Parameters
region3dRASTER3D_Region *
geodataN_geom_data * - if a NULL pointer is given, a new structure will be allocatet and returned
Returns
N_geom_data *

Definition at line 73 of file n_geom.c.

References RASTER3D_Region::depths, N_geom_data::depths, N_geom_data::dim, N_geom_data::dz, G_database_units_to_meters_factor(), G_debug(), G_get_set_window(), N_alloc_geom_data(), N_init_geom_data_2d(), NULL, Rast3d_region_to_cell_head(), and RASTER3D_Region::tb_res.