Loading...
Searching...
No Matches
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.
void | G_get_default_window (struct Cell_head *window)
| Get the default region.
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.).
void | G_unset_window (void)
| Unset current region.

## 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] | window | pointer to Cell_head

Definition at line 99 of file get_window.c.

References G_get_element_window().

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] | window | pointer to Cell_head
  | element | element type
  | name | element name
  | mapset | mapset name

Definition at line 114 of file get_window.c.

References G__read_Cell_head(), G_fatal_error(), G_fopen_old(), G_ftell(), G_zero(), and name.

Referenced by G_get_default_window(), and G_get_window().

## 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] | window | pointer to Cell_head

Definition at line 47 of file get_window.c.

References G__read_Cell_head_array(), G_free_tokens(), G_get_element_window(), G_initialize_done(), G_is_initialized(), G_mapset(), G_tokenize(), G__::window, and G__::window_set.

Referenced by G__calloc(), G__init_window(), G__malloc(), G__realloc(), G_point_in_region(), P_set_dim(), and P_set_regions().

## G_unset_window()

void G_unset_window | ( | void |  | ) |

Unset current region.

Definition at line 139 of file get_window.c.

References G__::window_set.