GRASS 8 Programmer's Manual
8.5.0(2026)-8d6ceba290
Toggle main menu visibility
Loading...
Searching...
No Matches
wind_in.c
Go to the documentation of this file.
1
/*!
2
* \file lib/gis/wind_in.c
3
*
4
* \brief Point in region functions.
5
*
6
* This program is free software under the GNU General Public License
7
* (>=v2). Read the file COPYING that comes with GRASS for details.
8
*
9
* \author Hamish Bowman. (c) Hamish Bowman, and the GRASS Development Team
10
*
11
* \date February 2007
12
*/
13
14
#include <grass/gis.h>
15
16
/*!
17
* \brief Returns TRUE if coordinate is within the current region settings.
18
*
19
* \param easting
20
* \param northing
21
* \return int
22
*
23
*/
24
int
G_point_in_region
(
double
easting,
double
northing)
25
{
26
struct
Cell_head window;
27
28
G_get_window
(&window);
29
30
return
G_point_in_window
(easting, northing, &window);
31
}
32
33
/*!
34
* \brief Returns TRUE if coordinate is within the given map region.
35
*
36
* Use instead of G_point_in_region() when used in a loop (it's more
37
* efficient to only fetch the window once) or for checking if a point
38
* is in another region (e.g. contained with a raster map's bounds).
39
*
40
* \param easting
41
* \param northing
42
* \param window
43
* \return int
44
*
45
*/
46
int
G_point_in_window
(
double
easting,
double
northing,
47
const
struct
Cell_head *window)
48
{
49
50
if
(easting > window->east || easting < window->west ||
51
northing > window->north || northing < window->south)
52
return
FALSE
;
53
54
return
TRUE
;
55
}
TRUE
#define TRUE
Definition
dbfopen.c:56
FALSE
#define FALSE
Definition
dbfopen.c:55
G_get_window
void G_get_window(struct Cell_head *window)
Get the current region.
Definition
get_window.c:47
G_point_in_window
int G_point_in_window(double easting, double northing, const struct Cell_head *window)
Returns TRUE if coordinate is within the given map region.
Definition
wind_in.c:46
G_point_in_region
int G_point_in_region(double easting, double northing)
Returns TRUE if coordinate is within the current region settings.
Definition
wind_in.c:24
gis
wind_in.c
Generated on
for GRASS 8 Programmer's Manual by
1.17.0