GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-36359e2344
|
GIS Library - CELL header adjustment. More...
Go to the source code of this file.
Macros | |
#define | LL_TOLERANCE 10 |
Functions | |
void | G_adjust_Cell_head (struct Cell_head *cellhd, int row_flag, int col_flag) |
Adjust cell header. More... | |
void | G_adjust_Cell_head3 (struct Cell_head *cellhd, int row_flag, int col_flag, int depth_flag) |
Adjust cell header for 3D values. More... | |
int | G_adjust_window_ll (struct Cell_head *cellhd) |
Adjust window for lat/lon. More... | |
GIS Library - CELL header adjustment.
(C) 2001-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.
Definition in file adj_cellhd.c.
#define LL_TOLERANCE 10 |
Definition at line 19 of file adj_cellhd.c.
void G_adjust_Cell_head | ( | struct Cell_head * | cellhd, |
int | row_flag, | ||
int | col_flag | ||
) |
Adjust cell header.
This function fills in missing parts of the input cell header (or region). It also makes projection-specific adjustments. The cellhd structure must have its north, south, east, west, and proj fields set.
If row_flag is true, then the north-south resolution is computed from the number of rows in the cellhd structure. Otherwise the number of rows is computed from the north-south resolution in the structure, similarly for col_flag and the number of columns and the east-west resolution.
Note: 3D values are not adjusted.
[in,out] | cellhd | pointer to Cell_head structure |
row_flag | compute n-s resolution | |
col_flag | compute e-w resolution |
Definition at line 51 of file adj_cellhd.c.
References _, Cell_head::cols, Cell_head::ew_res, G_fatal_error(), Cell_head::north, Cell_head::ns_res, Cell_head::proj, PROJECTION_LL, Cell_head::rows, and Cell_head::south.
void G_adjust_Cell_head3 | ( | struct Cell_head * | cellhd, |
int | row_flag, | ||
int | col_flag, | ||
int | depth_flag | ||
) |
Adjust cell header for 3D values.
This function fills in missing parts of the input cell header (or region). It also makes projection-specific adjustments. The cellhd structure must have its north, south, east, west, and proj fields set.
If row_flag is true, then the north-south resolution is computed from the number of rows in the cellhd structure. Otherwise the number of rows is computed from the north-south resolution in the structure, similarly for col_flag and the number of columns and the east-west resolution.
If depth_flag is true, top-bottom resolution is calculated from depths. If depth_flag are false, number of depths is calculated from top-bottom resolution.
[in,out] | cellhd | pointer to Cell_head structure |
row_flag | compute n-s resolution | |
col_flag | compute e-w resolution | |
depth_flag | compute t-b resolution |
Definition at line 163 of file adj_cellhd.c.
References _, Cell_head::cols, Cell_head::cols3, Cell_head::depths, Cell_head::ew_res, Cell_head::ew_res3, G_fatal_error(), Cell_head::north, Cell_head::ns_res, Cell_head::ns_res3, Cell_head::proj, PROJECTION_LL, Cell_head::rows, Cell_head::rows3, Cell_head::south, and Cell_head::tb_res.
int G_adjust_window_ll | ( | struct Cell_head * | cellhd | ) |
Adjust window for lat/lon.
This function tries to automatically fix fp precision issues and adjust rounding errors for lat/lon.
Note: 3D values are not adjusted.
[in,out] | cellhd | pointer to Cell_head structure |
Definition at line 552 of file adj_cellhd.c.
References _, Cell_head::east, Cell_head::ew_res, G_fatal_error(), G_lat_format(), G_lat_scan(), G_llres_format(), G_llres_scan(), G_lon_format(), G_lon_scan(), Cell_head::north, Cell_head::ns_res, Cell_head::proj, PROJECTION_LL, Cell_head::south, and Cell_head::west.