overlap.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*!
  2. \file lib/vector/Vlib/overlap.c
  3. \brief Vector library - region/window overlap
  4. Higher level functions for reading/writing/manipulating vectors.
  5. (C) 2001-2009 by the GRASS Development Team
  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. \author Original author CERL, probably Dave Gerdes or Mike Higgins.
  9. \author Update to GRASS 5.7 Radim Blazek and David D. Gray.
  10. */
  11. #include <grass/vector.h>
  12. /*!
  13. Check if region overlaps with map extent.
  14. \param Map vector map
  15. \param n,s,e,w region bounding box
  16. \return 1 if regions overlap
  17. \return 0 if not
  18. */
  19. int
  20. V__map_overlap(struct Map_info *Map, double n, double s, double e, double w)
  21. {
  22. struct Cell_head W;
  23. /* updated for Lat lon support 21 Jun 91 */
  24. W.north = Map->constraint.box.N;
  25. W.south = Map->constraint.box.S;
  26. W.east = Map->constraint.box.E;
  27. W.west = Map->constraint.box.W;
  28. W.proj = Map->head.proj;
  29. return G_window_overlap(&W, n, s, e, w);
  30. }