GRASS 8 Programmer's Manual 8.6.0dev(2026)-0f6a7341fc
Loading...
Searching...
No Matches
gprojects.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * MODULE: gproj library
4 * AUTHOR(S): Original Author unknown, probably Soil Conservation Service
5 * Paul Kelly
6 * PURPOSE: Include file for GRASS modules that use the PROJ
7 * wrapper functions
8 * SPDX-FileCopyrightText: 2003 GRASS Development Team
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 *
11 *****************************************************************************/
12
13#ifndef GRASS_GPROJECTS_H
14#define GRASS_GPROJECTS_H
15
16#include <grass/config.h>
17
18#include <ogr_srs_api.h>
19
20/* TODO: clean up support for PROJ 5+ */
21#include <proj.h>
22#define RAD_TO_DEG 57.295779513082321
23#define DEG_TO_RAD .017453292519943296
24
25#ifndef PJ_WKT2_LATEST
26/* update if new PROJ versions support new WKT2 standards */
27#define PJ_WKT2_LATEST PJ_WKT2_2019
28#endif
29
30/* Data Files */
31#define ELLIPSOIDTABLE "/etc/proj/ellipse.table"
32#define DATUMTABLE "/etc/proj/datum.table"
33#define DATUMTRANSFORMTABLE "/etc/proj/datumtransform.table"
34/* GRASS relative location of datum conversion lookup tables */
35#define GRIDDIR "/etc/proj/nad"
36
37/* TODO: rename pj_ to gpj_ to avoid symbol clash with PROJ lib */
38struct pj_info {
39 PJ *pj;
40 double meters;
41 int zone;
42 char proj[100];
43 char *def;
44 char *srid;
45 char *wkt;
46};
47
48struct gpj_datum {
49 char *name, *longname, *ellps;
50 double dx, dy, dz;
51};
52
53/* no longer needed with PROJ6+ */
55
56 int count; /**< Transform Number (ordered list) */
57
58 char *params; /**< PROJ.4-style datum transform parameters */
59
60 char *where_used; /**< Comment text describing where (geographically)
61 * the transform is valid */
62
63 char *comment; /**< Additional Comments */
64
66 *next; /**< Pointer to next set of
67 * transform parameters in linked list */
68};
69
70struct gpj_ellps {
71 char *name, *longname;
72 double a, es, rf;
73};
74
76
77#endif
struct gpj_datum_transform_list * next
Definition gprojects.h:65
double dz
Definition gprojects.h:50
char * longname
Definition gprojects.h:49
double dy
Definition gprojects.h:50
char * ellps
Definition gprojects.h:49
double dx
Definition gprojects.h:50
char * name
Definition gprojects.h:49
double es
Definition gprojects.h:72
char * name
Definition gprojects.h:71
double a
Definition gprojects.h:72
double rf
Definition gprojects.h:72
char * longname
Definition gprojects.h:71
char proj[100]
Definition gprojects.h:42
int zone
Definition gprojects.h:41
char * def
Definition gprojects.h:43
PJ * pj
Definition gprojects.h:39
char * srid
Definition gprojects.h:44
char * wkt
Definition gprojects.h:45
double meters
Definition gprojects.h:40