13 Rast3d_readWriteWindow(
struct Key_Value *windowKeys,
int doRead,
int *proj,
14 int *zone,
double *north,
double *south,
double *east,
15 double *west,
double *top,
double *bottom,
int *rows,
16 int *cols,
int *depths,
double *ew_res,
double *ns_res,
20 int (*windowInt) (), (*windowDouble) ();
53 Rast3d_error(
"Rast3d_readWriteWindow: error writing window");
61 static void Rast3d_getFullWindowPath(
char *
path,
const char *windowName)
65 if (windowName ==
NULL) {
70 while (*windowName ==
' ')
74 sprintf(path,
"%s", windowName);
146 if (windowName ==
NULL) {
165 Rast3d_getFullWindowPath(path, windowName);
167 if (access(path,
R_OK) != 0) {
168 G_warning(
"Rast3d_read_window: unable to find [%s].", path);
174 if (!Rast3d_readWriteWindow(windowKeys, 1,
183 (
"Rast3d_read_window: error extracting window key(s) of file %s",
char * G_file_name(char *, const char *, const char *, const char *)
Builds full path names to GIS data files.
struct Key_Value * G_read_key_value_file(const char *)
Read key/values pairs from file.
void Rast3d_set_window_params(void)
int Rast3d_key_set_int(struct Key_Value *, const char *, const int *)
2D/3D raster map header (used also for region)
double west
Extent coordinates (west)
#define RASTER3D_WINDOW_ELEMENT
#define RASTER3D_REGION_ROWS
#define RASTER3D_REGION_WEST
int cols3
Number of columns for 3D data.
double top
Extent coordinates (top) - 3D data.
void Rast3d_error(const char *,...) __attribute__((format(printf
#define RASTER3D_REGION_TBRES
#define RASTER3D_REGION_NSRES
double north
Extent coordinates (north)
#define RASTER3D_REGION_NORTH
double ns_res3
Resolution - north to south cell size for 3D data.
int rows3
Number of rows for 3D data.
double south
Extent coordinates (south)
int zone
Projection zone (UTM)
double bottom
Extent coordinates (bottom) - 3D data.
#define RASTER3D_REGION_SOUTH
#define RASTER3D_REGION_TOP
int depths
number of depths for 3D data
int Rast3d_key_set_double(struct Key_Value *, const char *, const double *)
#define RASTER3D_REGION_EAST
#define RASTER3D_REGION_BOTTOM
#define RASTER3D_REGION_EWRES
const char * G_mapset(void)
Get current mapset name.
void G_warning(const char *,...) __attribute__((format(printf
#define RASTER3D_REGION_PROJ
#define RASTER3D_REGION_COLS
void Rast3d_use_window_params(void)
Writes window to the file specified by windowName. The name is converted by the rules defined in wind...
double east
Extent coordinates (east)
#define RASTER3D_REGION_DEPTHS
int Rast3d_key_get_double(struct Key_Value *, const char *, double *)
int Rast3d_key_get_int(struct Key_Value *, const char *, int *)
#define RASTER3D_WINDOW_DATABASE
double tb_res
Resolution - top to bottom cell size for 3D data.
int G_name_is_fully_qualified(const char *, char *, char *)
Check if map name is fully qualified (map @ mapset)
void G_get_window(struct Cell_head *)
Get the current region.
void G_free_key_value(struct Key_Value *)
Free allocated Key_Value structure.
#define RASTER3D_REGION_ZONE
double ew_res3
Resolution - east to west cell size for 3D data.
int Rast3d_read_window(RASTER3D_Region *window, const char *windowName)
Reads window from the file specified by windowName. The name is converted by the rules defined in win...