GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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
29 V__map_overlap(struct Map_info *Map, double n, double s, double e, double w)
30 {
31  struct Cell_head W;
32
33  /* updated for Lat lon support 21 Jun 91 */
34  W.north = Map->constraint.box.N;
35  W.south = Map->constraint.box.S;
36  W.east = Map->constraint.box.E;
37  W.west = Map->constraint.box.W;
38  W.proj = Map->head.proj;
39
40  return G_window_overlap(&W, n, s, e, w);
41 }
int V__map_overlap(struct Map_info *Map, double n, double s, double e, double w)
Definition: overlap.c:29
double W
West.
Definition: dig_structs.h:82
2D/3D raster map header (used also for region)
Definition: gis.h:412
double west
Extent coordinates (west)
Definition: gis.h:464
double E
East.
Definition: dig_structs.h:78
double N
North.
Definition: dig_structs.h:70
double north
Extent coordinates (north)
Definition: gis.h:458
struct Map_info::@11 constraint
Constraints for sequential feature access.
double south
Extent coordinates (south)
Definition: gis.h:460
int proj
Projection code.
Definition: gis.h:444
struct bound_box box
Region (bbox) constraint.
Definition: dig_structs.h:1366