aboutsummaryrefslogtreecommitdiff
path: root/src/proj.h
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2018-02-10 23:02:47 +0100
committerGitHub <noreply@github.com>2018-02-10 23:02:47 +0100
commit2cca9ead11be47f6efd0ab504cf2e9020b85fa80 (patch)
tree17c577bef2e0c38e13b9819f5d882d5587292349 /src/proj.h
parentc99cf890e3ce13ddc5cfaae092851ccf77182ea3 (diff)
downloadPROJ-2cca9ead11be47f6efd0ab504cf2e9020b85fa80.tar.gz
PROJ-2cca9ead11be47f6efd0ab504cf2e9020b85fa80.zip
Make the 4D API fully 4D (#788)
Make 4D API fully 4D: Remove PJ_XY, PJ_LP, PJ_XYZ, PJ_LPZ etc. from the API surface and make all formal parameters of the API fully 4D PJ_COORD. This operation primarily influences the proj_XXX_dist functions, which mostly work by calling Charles Karney's geodesic subsystem, keeping the distance, and throwing away the start and end azimuths for the geodesic computed. Also a PJ_GEOD(esic) persona is introduced for the PJ_COORD type. The proj_geod function returns a PJ_GEOD, representing the geodesic between the points represented by its PJ_COORD arguments. Finally, the proj_factors functions had its lp argument changed from PJ_LP to PJ_COORD.
Diffstat (limited to 'src/proj.h')
-rw-r--r--src/proj.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/src/proj.h b/src/proj.h
index 950cc271..8997965e 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -112,13 +112,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*****************************************************************************/
-/*
-#ifdef _MSC_VER
-#ifndef _USE_MATH_DEFINES
-#define _USE_MATH_DEFINES
-#endif
-#endif
-#include <math.h> For M_PI */
+
#include <stddef.h> /* For size_t */
@@ -151,11 +145,6 @@ typedef union PJ_COORD PJ_COORD;
struct PJ_AREA;
typedef struct PJ_AREA PJ_AREA;
-/* 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 */
@@ -210,8 +199,9 @@ 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 */
typedef struct { double e, n, u; } PJ_ENU; /* East, North, Up */
+typedef struct { double s, a1, a2; } PJ_GEOD; /* Geodesic length, fwd azi, rev azi */
-/* Classic proj.4 pair/triplet types */
+/* Classic proj.4 pair/triplet types - moved into the PJ_ name space */
typedef struct { double u, v; } PJ_UV;
typedef struct { double x, y; } PJ_XY;
typedef struct { double lam, phi; } PJ_LP;
@@ -227,6 +217,7 @@ union PJ_COORD {
PJ_XYZT xyzt;
PJ_UVWT uvwt;
PJ_LPZT lpzt;
+ PJ_GEOD geod;
PJ_OPK opk;
PJ_ENU enu;
PJ_XYZ xyz;
@@ -336,16 +327,20 @@ PJ_COORD proj_coord (double x, double y, double z, double t);
double proj_roundtrip (PJ *P, PJ_DIRECTION direction, int n, PJ_COORD *coo);
/* Geodesic distance between two points with angular 2D coordinates */
-double proj_lp_dist (const PJ *P, PJ_LP a, PJ_LP b);
+double proj_lp_dist (const PJ *P, PJ_COORD a, PJ_COORD b);
/* The geodesic distance AND the vertical offset */
-double proj_lpz_dist (const PJ *P, PJ_LPZ a, PJ_LPZ b);
+double proj_lpz_dist (const PJ *P, PJ_COORD a, PJ_COORD b);
/* Euclidean distance between two points with linear 2D coordinates */
-double proj_xy_dist (PJ_XY a, PJ_XY b);
+double proj_xy_dist (PJ_COORD a, PJ_COORD b);
/* Euclidean distance between two points with linear 3D coordinates */
-double proj_xyz_dist (PJ_XYZ a, PJ_XYZ b);
+double proj_xyz_dist (PJ_COORD a, PJ_COORD b);
+
+/* Geodesic distance (in meter) + fwd and rev azimuth between two points on the ellipsoid */
+PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b);
+
/* Set or read error level */
@@ -355,7 +350,7 @@ int proj_errno_reset (const PJ *P);
int proj_errno_restore (const PJ *P, int err);
/* Scaling and angular distortion factors */
-PJ_FACTORS proj_factors(PJ *P, PJ_LP lp);
+PJ_FACTORS proj_factors(PJ *P, PJ_COORD lp);
/* Info functions - get information about various PROJ.4 entities */
PJ_INFO proj_info(void);