GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
Loading...
Searching...
No Matches
proj2.c
Go to the documentation of this file.
1/*!
2 \file lib/gis/proj2.c
3
4 \brief GIS Library - Projection support (internal subroutines)
5
6 (C) 2001-2011 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 Original author CERL
12 */
13
14#include <grass/gis.h>
15#include <grass/glocale.h>
16
17/*!
18 \brief Get projection units code (for internal use only)
19
20 \param n projection code
21
22 Supported units (see gis.h):
23 - U_UNKNOWN (XY)
24 - U_METERS (UTM)
25 - U_FEET (SP)
26 - U_USFEET (a few SP)
27 - U_DEGREES (LL)
28
29 \return units code (see gis.h)
30 \return U_UNDEFINED if not defined
31 */
33{
34 switch (n) {
35 case PROJECTION_XY:
36 return U_UNKNOWN;
37 case PROJECTION_UTM:
38 return U_METERS;
39 case PROJECTION_LL:
40 return U_DEGREES;
41 default:
42 return U_UNDEFINED;
43 }
44 return U_UNDEFINED;
45}
46
47/*!
48 \brief Get projection name
49
50 \param n projection code
51
52 \return projection name
53 \return NULL on error
54 */
55const char *G_projection_name(int n)
56{
57 switch (n) {
58 case PROJECTION_XY:
59 return "x,y";
60 case PROJECTION_UTM:
61 return "UTM";
62 case PROJECTION_LL:
63 return _("Latitude-Longitude");
64 case PROJECTION_OTHER:
65 return _("Other Projection");
66 default:
67 return NULL;
68 }
69}
#define NULL
Definition ccmath.h:32
int G_projection_units(int n)
Get projection units code (for internal use only)
Definition proj2.c:32
const char * G_projection_name(int n)
Get projection name.
Definition proj2.c:55