GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73390
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
gprojects.h
Go to the documentation of this file.
1 /*
2  ******************************************************************************
3  *
4  * MODULE: gproj library
5  * AUTHOR(S): Original Author unknown, probably Soil Conservation Service
6  * Paul Kelly
7  * PURPOSE: Include file for GRASS modules that use the PROJ.4
8  * wrapper functions
9  * COPYRIGHT: (C) 2003 by the GRASS Development Team
10  *
11  * This program is free software under the GNU General Public
12  * License (>=v2). Read the file COPYING that comes with GRASS
13  * for details.
14  *
15  *****************************************************************************/
16 
17 #ifndef GRASS_GPROJECTS_H
18 #define GRASS_GPROJECTS_H
19 
20 #include <grass/config.h>
21 /* TODO: clean up support for PROJ 5+ */
22 #ifdef HAVE_PROJ_H
23 #include <proj.h>
24 #define RAD_TO_DEG 57.295779513082321
25 #define DEG_TO_RAD .017453292519943296
26 #else
27 #include <proj_api.h>
28 #define PJ_FWD 1
29 #define PJ_INV -1
30 #endif
31 #ifdef HAVE_OGR
32 # include <ogr_srs_api.h>
33 #endif
34 
35 /* Data Files */
36 #define ELLIPSOIDTABLE "/etc/proj/ellipse.table"
37 #define DATUMTABLE "/etc/proj/datum.table"
38 #define DATUMTRANSFORMTABLE "/etc/proj/datumtransform.table"
39 /* GRASS relative location of datum conversion lookup tables */
40 #define GRIDDIR "/etc/proj/nad"
41 
42 /* TODO: rename pj_ to gpj_ to avoid symbol clash with PROJ lib */
43 struct pj_info
44 {
45 #ifdef HAVE_PROJ_H
46  PJ *pj;
47 #else
48  projPJ pj;
49 #endif
50  double meters;
51  int zone;
52  char proj[100];
53  char *def;
54 };
55 
56 struct gpj_datum
57 {
58  char *name, *longname, *ellps;
59  double dx, dy, dz;
60 };
61 
63 {
64 
65  int count; /**< Transform Number (ordered list) */
66 
67  char *params; /**< PROJ.4-style datum transform parameters */
68 
69  char *where_used; /**< Comment text describing where (geographically)
70  * the transform is valid */
71 
72  char *comment; /**< Additional Comments */
73 
74  struct gpj_datum_transform_list *next; /**< Pointer to next set of
75  * transform parameters in linked list */
76 };
77 
78 struct gpj_ellps
79 {
80  char *name, *longname;
81  double a, es, rf;
82 };
83 
84 #ifndef HAVE_PROJ_H
85 /* PROJ.4's private datastructures copied from projects.h as removed
86  from upstream; pending better solution. see:
87  http://trac.osgeo.org/proj/ticket/98 */
88 
89 /* In PROJ 5, the 'struct FACTORS' is back in as 'struct P5_FACTORS',
90  * and old 'struct LP' is now back in as 'PJ_UV' */
91 
92 typedef struct { double u, v; } LP;
93 
94 struct DERIVS {
95  double x_l, x_p; /* derivatives of x for lambda-phi */
96  double y_l, y_p; /* derivatives of y for lambda-phi */
97 };
98 
99 struct FACTORS {
100  struct DERIVS der;
101  double h, k; /* meridinal, parallel scales */
102  double omega, thetap; /* angular distortion, theta prime */
103  double conv; /* convergence */
104  double s; /* areal scale factor */
105  double a, b; /* max-min scale error */
106  int code; /* info as to analytics, see following */
107 };
108 /* end of copy */
109 #endif
110 
111 #include <grass/defs/gprojects.h>
112 
113 #endif
double b
Definition: gprojects.h:105
double a
Definition: gprojects.h:105
struct DERIVS der
Definition: gprojects.h:100
Definition: gprojects.h:92
double dx
Definition: gprojects.h:59
double x_p
Definition: gprojects.h:95
char proj[100]
Definition: gprojects.h:52
double thetap
Definition: gprojects.h:102
int zone
Definition: gprojects.h:51
double a
Definition: gprojects.h:81
double s
Definition: gprojects.h:104
double y_p
Definition: gprojects.h:96
char * name
Definition: gprojects.h:58
double h
Definition: gprojects.h:101
double omega
Definition: gprojects.h:102
projPJ pj
Definition: gprojects.h:48
int code
Definition: gprojects.h:106
char * def
Definition: gprojects.h:53
char * ellps
Definition: gprojects.h:58
char * name
Definition: gprojects.h:80
char * longname
Definition: gprojects.h:58
double v
Definition: gprojects.h:92
char * longname
Definition: gprojects.h:80
double meters
Definition: gprojects.h:50
double es
Definition: gprojects.h:81
double y_l
Definition: gprojects.h:96
double dz
Definition: gprojects.h:59
double dy
Definition: gprojects.h:59
struct gpj_datum_transform_list * next
Definition: gprojects.h:74
double conv
Definition: gprojects.h:103
double k
Definition: gprojects.h:101
double rf
Definition: gprojects.h:81
double x_l
Definition: gprojects.h:95