GRASS 8 Programmer's Manual 8.6.0dev(2026)-f6f2c534ea
Loading...
Searching...
No Matches
wind_limits.c
Go to the documentation of this file.
1/*!
2 * \file lib/gis/wind_limits.c
3 *
4 * \brief GIS Library - Projection limit functions.
5 *
6 * (C) 2001-2014 by the GRASS Development Team
7 *
8 * This program is free software under the GNU General Public License
9 * (>=v2). Read the file COPYING that comes with GRASS for details.
10 *
11 * \author GRASS Development Team
12 *
13 * \date 1999-2014
14 */
15
16#include <grass/gis.h>
17
18/**
19 * \brief Function not yet implemented...
20 *
21 * If the projection has absolute limits (like lat/lon), then
22 * this routine modifies the input coordinate to be within the
23 * limit.<br>
24 *
25 * <b>Note:</b> Function not yet implemented.
26 *
27 * \param[in] east
28 * \param[in] proj
29 * \return 1 no change
30 * \return 0 changed
31 */
32int G_limit_east(double *east UNUSED, int proj UNUSED)
33{
34 return 1;
35}
36
37/**
38 * \brief Function not yet implemented...
39 *
40 * If the projection has absolute limits (like lat/lon), then
41 * this routine modifies the input coordinate to be within the
42 * limit.<br>
43 *
44 * <b>Note:</b> Function not yet implemented.
45 *
46 * \param[in] west
47 * \param[in] proj
48 * \return 1 no change
49 * \return 0 changed
50 */
51int G_limit_west(double *west UNUSED, int proj UNUSED)
52{
53 return 1;
54}
55
56/**
57 * \brief Limit north (y) coordinate
58 *
59 * If the projection has absolute limits (like lat/lon), then
60 * this routine modifies the input coordinate to be within the
61 * limit.<br>
62 *
63 * \param[in,out] north north coordinate
64 * \param[in] proj projection id
65 * \return 1 no change
66 * \return 0 changed
67 */
68int G_limit_north(double *north, int proj)
69{
70 if (proj == PROJECTION_LL) {
71 if (*north > 90.0) {
72 *north = 90.0;
73 return 0;
74 }
75 if (*north < -90) {
76 *north = -90;
77 return 0;
78 }
79 }
80
81 return 1;
82}
83
84/**
85 * \brief Limit south (y) coordinate
86 *
87 * If the projection has absolute limits (like lat/lon), then
88 * this routine modifies the input coordinate to be within the
89 * limit.<br>
90 *
91 * \param[in] south south coordinate
92 * \param[in] proj projection id
93 * \return 1 no change
94 * \return 0 changed
95 */
96int G_limit_south(double *south, int proj)
97{
98 if (proj == PROJECTION_LL) {
99 if (*south > 90.0) {
100 *south = 90.0;
101 return 0;
102 }
103 if (*south < -90) {
104 *south = -90;
105 return 0;
106 }
107 }
108
109 return 1;
110}
#define PROJECTION_LL
Projection code - Latitude-Longitude.
Definition gis.h:129
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
Definition gis.h:46
int G_limit_east(double *east, int proj)
Function not yet implemented...
Definition wind_limits.c:32
int G_limit_north(double *north, int proj)
Limit north (y) coordinate.
Definition wind_limits.c:68
int G_limit_south(double *south, int proj)
Limit south (y) coordinate.
Definition wind_limits.c:96
int G_limit_west(double *west, int proj)
Function not yet implemented...
Definition wind_limits.c:51