GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-eff64031f2
overlap.c
Go to the documentation of this file.
1 /*!
2  \file lib/vector/Vlib/overlap.c
3 
4  \brief Vector library - region/window overlap
5 
6  Higher level functions for reading/writing/manipulating vectors.
7 
8  (C) 2001-2009 by the GRASS Development Team
9 
10  This program is free software under the GNU General Public License
11  (>=v2). Read the file COPYING that comes with GRASS for details.
12 
13  \author Original author CERL, probably Dave Gerdes or Mike Higgins.
14  \author Update to GRASS 5.7 Radim Blazek and David D. Gray.
15  */
16 
17 #include <grass/vector.h>
18 
19 /*!
20  Check if region overlaps with map extent.
21 
22  \param Map vector map
23  \param n,s,e,w region bounding box
24 
25  \return 1 if regions overlap
26  \return 0 if not
27  */
28 int V__map_overlap(struct Map_info *Map, double n, double s, double e, double w)
29 {
30  struct Cell_head W;
31 
32  /* updated for Lat lon support 21 Jun 91 */
33  W.north = Map->constraint.box.N;
34  W.south = Map->constraint.box.S;
35  W.east = Map->constraint.box.E;
36  W.west = Map->constraint.box.W;
37  W.proj = Map->head.proj;
38 
39  return G_window_overlap(&W, n, s, e, w);
40 }
int G_window_overlap(const struct Cell_head *, double, double, double, double)
Determines if a box overlays a map window.
Definition: wind_overlap.c:35
#define W
Definition: ogsf.h:143
int V__map_overlap(struct Map_info *Map, double n, double s, double e, double w)
Definition: overlap.c:28
2D/3D raster map header (used also for region)
Definition: gis.h:437
Vector map info.
Definition: dig_structs.h:1243
struct dig_head head
Header info.
Definition: dig_structs.h:1388
struct bound_box box
Region (bbox) constraint.
Definition: dig_structs.h:1351
struct Map_info::@11 constraint
Constraints for sequential feature access.
double W
West.
Definition: dig_structs.h:80
double S
South.
Definition: dig_structs.h:72
double N
North.
Definition: dig_structs.h:68
double E
East.
Definition: dig_structs.h:76