diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2017-11-27 20:21:52 +0100 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2017-11-27 20:23:25 +0100 |
| commit | f0181b0a24d9d3a8bb593811945fea008128f94a (patch) | |
| tree | c4ef5fc40f00481755c86f383be839b7b81eac68 /src/proj.h | |
| parent | 25b011042fdff451ca2826afe82251c06d883fb8 (diff) | |
| parent | 1f48f4c333bfe135296d3be643ef4981dc401c38 (diff) | |
| download | PROJ-f0181b0a24d9d3a8bb593811945fea008128f94a.tar.gz PROJ-f0181b0a24d9d3a8bb593811945fea008128f94a.zip | |
Merge remote-tracking branch 'osgeo/master' into docs-release-4.10.0
Diffstat (limited to 'src/proj.h')
| -rw-r--r-- | src/proj.h | 141 |
1 files changed, 41 insertions, 100 deletions
@@ -135,40 +135,15 @@ extern "C" { #endif -/************************************************************************ - These version numbers should be updated with every release! - The format of PJ_VERSION is - - * Before version 4.10.0: PJ_VERSION=MNP - where M, N, and P are the major, minor, and patch numbers; - e.g., PJ_VERSION=493 for version 4.9.3. - - * Version 4.10.0 and later: PJ_VERSION=MMMNNNPP later - where MMM, NNN, PP are the major, minor, and patch numbers. - The minor and patch numbers are padded with leading zeros if - necessary); - e.g., PJ_VERSION=401000 for version 4.10.0. -************************************************************************/ -#define PROJ_VERSION_MAJOR 10 +/* The version numbers should be updated with every release! **/ +#define PROJ_VERSION_MAJOR 5 #define PROJ_VERSION_MINOR 0 #define PROJ_VERSION_PATCH 0 -#ifndef PJ_VERSION -#define PJ_VERSION 10##000##00 -#endif -#ifndef PROJ_VERSION -#define PROJ_VERSION PJ_VERSION -#endif - - extern char const pj_release[]; /* global release id string */ /* first forward declare everything needed */ -/* Data type for generic geodetic 3D data */ -union PJ_TRIPLET; -typedef union PJ_TRIPLET PJ_TRIPLET; - /* Data type for generic geodetic 3D data plus epoch information */ union PJ_COORD; typedef union PJ_COORD PJ_COORD; @@ -176,11 +151,24 @@ typedef union PJ_COORD PJ_COORD; struct PJ_AREA; typedef struct PJ_AREA PJ_AREA; -struct DERIVS; -typedef struct DERIVS PJ_DERIVS; - -struct FACTORS; -typedef struct FACTORS PJ_FACTORS; +/* The slimmed down PROJ 5.0.0 version of struct FACTORS */ +/* Will take over the world and the name when we can rid */ +/* the library for deprecated stuff, but it's the typedef */ +/* which is userspace useful, so it does not do much of a */ +/* difference */ +struct P5_FACTORS { /* Common designation */ + double meridional_scale; /* h */ + double parallel_scale; /* k */ + double areal_scale; /* s */ + + double angular_distortion; /* omega */ + double meridian_parallel_angle; /* theta-prime */ + double meridian_convergence; /* alpha */ + + double tissot_semimajor; /* a */ + double tissot_semiminor; /* b */ +}; +typedef struct P5_FACTORS PJ_FACTORS; /* Data type for projection/transformation information */ struct PJconsts; @@ -213,17 +201,11 @@ struct PJ_PRIME_MERIDIANS; typedef struct PJ_PRIME_MERIDIANS PJ_PRIME_MERIDIANS; -/* Omega, Phi, Kappa: Rotations */ -typedef struct {double o, p, k;} PJ_OPK; - -/* Easting, Northing, and some kind of height (orthometric or ellipsoidal) */ -typedef struct {double e, n, h;} PJ_ENH; - -/* Geodetic spatiotemporal coordinate types */ +/* Geodetic, mostly spatiotemporal coordinate types */ typedef struct { double x, y, z, t; } PJ_XYZT; -typedef struct { double e, n, h, t; } PJ_ENHT; typedef struct { double u, v, w, t; } PJ_UVWT; typedef struct { double lam, phi, z, t; } PJ_LPZT; +typedef struct { double o, p, k; } PJ_OPK; /* Rotations: omega, phi, kappa */ /* Classic proj.4 pair/triplet types */ typedef struct { double u, v; } UV; @@ -234,60 +216,22 @@ typedef struct { double x, y, z; } XYZ; typedef struct { double u, v, w; } UVW; typedef struct { double lam, phi, z; } LPZ; -/* Ancillary pairs and triplets for geodetic computations */ - -/* easting and northing */ -typedef struct { double e, n; } PJ_EN; - -/* Degrees, minutes, and seconds */ -typedef struct { double d, m, s; } PJ_DMS; - -/* Geoid undulation (N) and deflections of the vertical (eta, zeta) */ -typedef struct { double e, z, N; } PJ_EZN; - -/* Ellipsoidal parameters */ -typedef struct { double a, f; } PJ_AF; -/* Avoid preprocessor renaming and implicit type-punning: Use unions to make it explicit */ +/* Avoid preprocessor renaming and implicit type-punning: Use a union to make it explicit */ union PJ_COORD { + double v[4]; /* First and foremost, it really is "just 4 numbers in a vector" */ PJ_XYZT xyzt; PJ_UVWT uvwt; - PJ_ENHT enht; PJ_LPZT lpzt; - PJ_ENH enh; - PJ_EN en; - double v[4]; /* It's just a vector */ - XYZ xyz; - UVW uvw; - LPZ lpz; - XY xy; - UV uv; - LP lp; + PJ_OPK opk; + XYZ xyz; + UVW uvw; + LPZ lpz; + XY xy; + UV uv; + LP lp; }; -union PJ_TRIPLET { - PJ_OPK opk; - PJ_ENH enh; - PJ_EZN ezn; - PJ_DMS dms; - double v[3]; /* It's just a vector */ - XYZ xyz; - LPZ lpz; - UVW uvw; - XY xy; - LP lp; - UV uv; - PJ_AF af; -}; - -union PJ_PAIR { - XY xy; - LP lp; - UV uv; - PJ_AF af; - PJ_EN en; - double v[2]; /* Yes - It's really just a vector! */ -}; struct PJ_INFO { char release[64]; /* Release info. Version + date */ @@ -341,7 +285,6 @@ PJ_CONTEXT *proj_context_create (void); PJ_CONTEXT *proj_context_destroy (PJ_CONTEXT *ctx); - /* Manage the transformation definition object PJ */ PJ *proj_create (PJ_CONTEXT *ctx, const char *definition); PJ *proj_create_argv (PJ_CONTEXT *ctx, int argc, char **argv); @@ -363,15 +306,12 @@ enum PJ_DIRECTION { typedef enum PJ_DIRECTION PJ_DIRECTION; - - int proj_angular_input (PJ *P, enum PJ_DIRECTION dir); int proj_angular_output (PJ *P, enum PJ_DIRECTION dir); PJ_COORD proj_trans (PJ *P, PJ_DIRECTION direction, PJ_COORD coord); - - +int proj_trans_array (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord); size_t proj_trans_generic ( PJ *P, PJ_DIRECTION direction, @@ -381,7 +321,6 @@ size_t proj_trans_generic ( double *t, size_t st, size_t nt ); -int proj_trans_array (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord); /* Initializers */ PJ_COORD proj_coord (double x, double y, double z, double t); @@ -403,14 +342,13 @@ double proj_xyz_dist (XYZ a, XYZ b); /* Set or read error level */ -int proj_errno (PJ *P); -void proj_errno_set (PJ *P, int err); -int proj_errno_reset (PJ *P); -void proj_errno_restore (PJ *P, int err); - +int proj_errno (const PJ *P); +int proj_errno_set (const PJ *P, int err); +int proj_errno_reset (const PJ *P); +int proj_errno_restore (const PJ *P, int err); -PJ_DERIVS proj_derivatives(PJ *P, const LP lp); -PJ_FACTORS proj_factors(PJ *P, const LP lp); +/* Scaling and angular distortion factors */ +PJ_FACTORS proj_factors(PJ *P, LP lp); /* Info functions - get information about various PROJ.4 entities */ PJ_INFO proj_info(void); @@ -431,6 +369,9 @@ const PJ_PRIME_MERIDIANS *proj_list_prime_meridians(void); double proj_torad (double angle_in_degrees); double proj_todeg (double angle_in_radians); +/* Geographical to geocentric latitude - another of the "simple, but useful" */ +PJ_COORD proj_geoc_lat (const PJ *P, PJ_DIRECTION direction, PJ_COORD coo); + double proj_dmstor(const char *is, char **rs); char* proj_rtodms(char *s, double r, int pos, int neg); |
