overlap.c 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*!
  2. \file 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/config.h>
  12. #include <grass/gis.h>
  13. #include <grass/vector.h>
  14. /*!
  15. Check if region overlaps with map extent.
  16. \param Map vector map
  17. \param n,s,e,w region bounding box
  18. \return 1 if regions overlap
  19. \return 0 if not
  20. */
  21. int
  22. V__map_overlap(struct Map_info *Map, double n, double s, double e, double w)
  23. {
  24. struct Cell_head W;
  25. /* updated for Lat lon support 21 Jun 91 */
  26. W.north = Map->Constraint_N;
  27. W.south = Map->Constraint_S;
  28. W.east = Map->Constraint_E;
  29. W.west = Map->Constraint_W;
  30. W.proj = Map->proj;
  31. return G_window_overlap(&W, n, s, e, w);
  32. }