GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-77aab223bc
get_window.c File Reference

GIS Library - Get window (i.e. GRASS region) More...

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "G.h"
#include "gis_local_proto.h"
Include dependency graph for get_window.c:

Go to the source code of this file.

Functions

void G_get_window (struct Cell_head *window)
 Get the current region. More...
 
void G_get_default_window (struct Cell_head *window)
 Get the default region. More...
 
void G_get_element_window (struct Cell_head *window, const char *element, const char *name, const char *mapset)
 Get region for selected element (raster, vector, window, etc.) More...
 
void G_unset_window (void)
 Unset current region. More...
 

Detailed Description

GIS Library - Get window (i.e. GRASS region)

(C) 2001-2009, 2011 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 get_window.c.

Function Documentation

◆ G_get_default_window()

void G_get_default_window ( struct Cell_head window)

Get the default region.

Reads the default region for the location into region. 3D values are set to defaults if not available in WIND file.

An error message is printed and exit() is called if there is a problem reading the default region.

Parameters
[out]windowpointer to Cell_head

Definition at line 95 of file get_window.c.

Referenced by G_make_mapset().

◆ G_get_element_window()

void G_get_element_window ( struct Cell_head window,
const char *  element,
const char *  name,
const char *  mapset 
)

Get region for selected element (raster, vector, window, etc.)

G_fatal_error() is called on error

Parameters
[out]windowpointer to Cell_head
elementelement type
nameelement name
mapsetmapset name

Definition at line 110 of file get_window.c.

◆ G_get_window()

void G_get_window ( struct Cell_head window)

Get the current region.

Reads the region as stored in the WIND file in the user's current mapset into region.

3D values are set to defaults if not available in WIND file. An error message is printed and exit() is called if there is a problem reading the region.

Note: GRASS applications that read or write raster maps should not use this routine since its use implies that the active module region will not be used. Programs that read or write raster map data (or vector data) can query the active module region using Rast_window_rows() and Rast_window_cols().

Parameters
[out]windowpointer to Cell_head

Definition at line 47 of file get_window.c.

Referenced by G__init_window(), and P_set_dim().

◆ G_unset_window()

void G_unset_window ( void  )

Unset current region.

Definition at line 135 of file get_window.c.

References st, and G__::window_set.