GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
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 SPDX-FileCopyrightText: 2001-2011 GRASS Development Team
7 SPDX-License-Identifier: GPL-2.0-or-later
8
9 \author Original author CERL
10 */
11
12#include <grass/gis.h>
13#include <grass/glocale.h>
14
15/*!
16 \brief Get projection units code (for internal use only)
17
18 \param n projection code
19
20 Supported units (see gis.h):
21 - U_UNKNOWN (XY)
22 - U_METERS (UTM)
23 - U_FEET (SP)
24 - U_USFEET (a few SP)
25 - U_DEGREES (LL)
26
27 \return units code (see gis.h)
28 \return U_UNDEFINED if not defined
29 */
31{
32 switch (n) {
33 case PROJECTION_XY:
34 return U_UNKNOWN;
35 case PROJECTION_UTM:
36 return U_METERS;
37 case PROJECTION_LL:
38 return U_DEGREES;
39 default:
40 return U_UNDEFINED;
41 }
42 return U_UNDEFINED;
43}
44
45/*!
46 \brief Get projection name
47
48 \param n projection code
49
50 \return projection name
51 \return NULL on error
52 */
53const char *G_projection_name(int n)
54{
55 switch (n) {
56 case PROJECTION_XY:
57 return "x,y";
58 case PROJECTION_UTM:
59 return "UTM";
60 case PROJECTION_LL:
61 return _("Latitude-Longitude");
63 return _("Other Projection");
64 default:
65 return NULL;
66 }
67}
#define NULL
Definition ccmath.h:32
#define PROJECTION_OTHER
Projection code - other projection (other then noted above)
Definition gis.h:128
#define PROJECTION_XY
Projection code - XY coordinate system (unreferenced data)
Definition gis.h:120
#define U_UNDEFINED
List of units.
Definition gis.h:100
#define U_METERS
Definition gis.h:105
#define U_DEGREES
Definition gis.h:109
#define PROJECTION_UTM
Projection code - UTM.
Definition gis.h:122
#define U_UNKNOWN
Definition gis.h:101
#define PROJECTION_LL
Projection code - Latitude-Longitude.
Definition gis.h:126
#define _(str)
Definition glocale.h:10
int G_projection_units(int n)
Get projection units code (for internal use only)
Definition proj2.c:30
const char * G_projection_name(int n)
Get projection name.
Definition proj2.c:53