-
-
Notifications
You must be signed in to change notification settings - Fork 288
/
wind_limits.c
119 lines (103 loc) · 2.15 KB
/
wind_limits.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*!
* \file lib/gis/wind_limits.c
*
* \brief GIS Library - Projection limit 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
*/
#include <grass/gis.h>
/**
* \brief Function not yet implemented...
*
* If the projection has absolute limits (like lat/lon), then
* this routine modifies the input coordinate to be within the
* limit.<br>
*
* <b>Note:</b> Function not yet implemented.
*
* \param[in] east
* \param[in] proj
* \return 1 no change
* \return 0 changed
*/
int G_limit_east(double *east, int proj)
{
return 1;
}
/**
* \brief Function not yet implemented...
*
* If the projection has absolute limits (like lat/lon), then
* this routine modifies the input coordinate to be within the
* limit.<br>
*
* <b>Note:</b> Function not yet implemented.
*
* \param[in] west
* \param[in] proj
* \return 1 no change
* \return 0 changed
*/
int G_limit_west(double *west, int proj)
{
return 1;
}
/**
* \brief Limit north (y) coordinate
*
* If the projection has absolute limits (like lat/lon), then
* this routine modifies the input coordinate to be within the
* limit.<br>
*
* \param[in,out] north north coordinate
* \param[in] proj projection id
* \return 1 no change
* \return 0 changed
*/
int G_limit_north(double *north, int proj)
{
if (proj == PROJECTION_LL) {
if (*north > 90.0) {
*north = 90.0;
return 0;
}
if (*north < -90) {
*north = -90;
return 0;
}
}
return 1;
}
/**
* \brief Limit south (y) coordinate
*
* If the projection has absolute limits (like lat/lon), then
* this routine modifies the input coordinate to be within the
* limit.<br>
*
* \param[in] south south coordinate
* \param[in] proj projection id
* \return 1 no change
* \return 0 changed
*/
int G_limit_south(double *south, int proj)
{
if (proj == PROJECTION_LL) {
if (*south > 90.0) {
*south = 90.0;
return 0;
}
if (*south < -90) {
*south = -90;
return 0;
}
}
return 1;
}