GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71806
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
wind_overlap.c File Reference

GIS Library - Window overlap functions. More...

#include <grass/gis.h>
Include dependency graph for wind_overlap.c:

Go to the source code of this file.

Functions

int G_window_overlap (const struct Cell_head *window, double N, double S, double E, double W)
 Determines if a box overlays a map window. More...
 
double G_window_percentage_overlap (const struct Cell_head *window, double N, double S, double E, double W)
 Determines percentage of box is contained in the window. More...
 

Detailed Description

GIS Library - Window overlap functions.

(C) 2001-2014 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
GRASS GIS Development Team
Date
1999-2014

Definition in file wind_overlap.c.

Function Documentation

int G_window_overlap ( const struct Cell_head window,
double  N,
double  S,
double  E,
double  W 
)

Determines if a box overlays a map window.

Given a map window, and a box of N,S,E,W does the box overlap the map window?

Note: knows about global wrap-around for lat-long.

Parameters
[in]windowpointer to window structure
[in]Nnorth
[in]Ssouth
[in]Eeast
[in]Wwest
Returns
1 if box overlaps window
0 if box does not overlap window

Definition at line 37 of file wind_overlap.c.

References Cell_head::east, Cell_head::north, Cell_head::proj, PROJECTION_LL, Cell_head::south, and Cell_head::west.

Referenced by V__map_overlap().

double G_window_percentage_overlap ( const struct Cell_head window,
double  N,
double  S,
double  E,
double  W 
)

Determines percentage of box is contained in the window.

This version returns the percentage (from 0 to 1) of the box contained in the window. This feature can be used during vector plotting to decide if it is more efficient to do a level-one read of the whole vector map, or to pay the price of a level-two startup so only those arcs that enter the window are actually read.

Parameters
[in]windowpointer to widnow structure
[in]Nnorth
[in]Ssouth
[in]Eeast
[in]Wwest
Returns
percentage of overlap

Definition at line 83 of file wind_overlap.c.

References Cell_head::east, H, N, Cell_head::north, Cell_head::proj, PROJECTION_LL, Cell_head::south, W, and Cell_head::west.