GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73570
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
align_window.c File Reference

GIS Library - Window alignment functions. More...

#include <stdio.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/raster.h>
Include dependency graph for align_window.c:

Go to the source code of this file.

Functions

void Rast_align_window (struct Cell_head *window, const struct Cell_head *ref)
 Align two regions. More...
 

Detailed Description

GIS Library - Window alignment functions.

(C) 2001-2009 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
Original author CERL

Definition in file align_window.c.

Function Documentation

void Rast_align_window ( struct Cell_head window,
const struct Cell_head ref 
)

Align two regions.

Modifies the input window to align to ref region. The resolutions in window are set to match those in ref and the window edges (north, south, east, west) are modified to align with the grid of the ref region.

The window may be enlarged if necessary to achieve the alignment. The north is rounded northward, the south southward, the east eastward and the west westward. Lon-lon constraints are taken into consideration to make sure that the north doesn't go above 90 degrees (for lat/lon) or that the east does "wrap" past the west, etc.

Parameters
[in,out]windowpointer to Cell_head to be modified
refpointer to Cell_head
Returns
NULL on success

Definition at line 41 of file align_window.c.

References Cell_head::east, Cell_head::ew_res, G_adjust_Cell_head(), G_debug(), Cell_head::north, Cell_head::ns_res, Cell_head::proj, PROJECTION_LL, Cell_head::south, Cell_head::west, and Cell_head::zone.