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