Skip to content
Commits on Source (6)
......@@ -21,3 +21,7 @@ install (FILES
install (EXPORT targets
FILE ${PROJECT_NAME_LOWER}-targets.cmake
DESTINATION "${CMAKECONFIGDIR}")
install (EXPORT targets
NAMESPACE ${PROJECT_NAME}::
FILE ${PROJECT_NAME_LOWER}-namespace-targets.cmake
DESTINATION "${CMAKECONFIGDIR}")
......@@ -23,6 +23,7 @@ set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/@BINDIR@")
set (@PROJECT_NAME@_LIBRARIES proj)
# Read in the exported definition of the library
include ("${_DIR}/@PROJECT_NAME_LOWER@-targets.cmake")
include ("${_DIR}/@PROJECT_NAME_LOWER@-namespace-targets.cmake")
unset (_ROOT)
unset (_DIR)
......
proj (5.0.0~rc3-1~exp1) experimental; urgency=medium
* New upstream release candidate.
* Drop patches, applied/included upstream.
* Update symbols for 5.0.0~rc3.
-- Bas Couwenberg <sebastic@debian.org> Wed, 14 Feb 2018 07:34:04 +0100
proj (5.0.0~rc2-1~exp4) experimental; urgency=medium
* Add patch for missing ! in boolean evaluation.
......
......@@ -666,6 +666,7 @@ libproj.so.13 #PACKAGE# #MINVER#
proj_angular_output@Base 5.0.0~rc1
proj_context_create@Base 5.0.0~rc1
proj_context_destroy@Base 5.0.0~rc1
proj_context_errno@Base 5.0.0~rc3
proj_context_errno_set@Base 5.0.0~rc1
proj_context_inherit@Base 5.0.0~rc1
proj_context_set@Base 5.0.0~rc1
......@@ -682,6 +683,7 @@ libproj.so.13 #PACKAGE# #MINVER#
proj_errno_set@Base 5.0.0~rc1
proj_factors@Base 5.0.0~rc1
proj_geocentric_latitude@Base 5.0.0~rc1
proj_geod@Base 5.0.0~rc3
proj_get_path_count@Base 5.0.0~rc1
proj_get_searchpath@Base 5.0.0~rc1
proj_grid_info@Base 5.0.0~rc1
......
From 332bf648a65b5a1a6bb1e2f5d7f5c7cca1ce1159 Mon Sep 17 00:00:00 2001
From: Kristian Evers <kristianevers@gmail.com>
Date: Sun, 11 Feb 2018 16:07:18 +0100
Subject: Add missing ! in boolean evaluation. Fixes #780.
---
src/pj_gridinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/src/pj_gridinfo.c
+++ b/src/pj_gridinfo.c
@@ -564,7 +564,7 @@ static int pj_gridinfo_init_ntv2( projCt
gi->gridname = pj_strdup( gilist->gridname );
gi->filename = pj_strdup( gilist->filename );
- if (!gi->gridname || gi->filename) {
+ if (!gi->gridname || !gi->filename) {
pj_gridinfo_free(ctx, gi);
pj_dalloc(ct);
pj_gridinfo_free(ctx, gilist);
Description: Avoid XY, LP and UV datatype clashes with other libraries.
Remove unnecessary definitions of UV and UVW from project.h that collides with
external libraries. To prevent similar problems in the future the
datatypes XY, LP, UV, XYZ, LPZ and UVW has been prefixed by PJ_ in
proj.h and proj_internal.h
Author: Kristian Evers <kristianevers@gmail.com>
Origin: https://github.com/OSGeo/proj.4/commit/9c75d794177276189d0a2809bc462291e1a070d3
--- a/src/proj.h
+++ b/src/proj.h
@@ -212,13 +212,13 @@ typedef struct { double o, p, k; }
typedef struct { double e, n, u; } PJ_ENU; /* East, North, Up */
/* Classic proj.4 pair/triplet types */
-typedef struct { double u, v; } UV;
-typedef struct { double x, y; } XY;
-typedef struct { double lam, phi; } LP;
-
-typedef struct { double x, y, z; } XYZ;
-typedef struct { double u, v, w; } UVW;
-typedef struct { double lam, phi, z; } LPZ;
+typedef struct { double u, v; } PJ_UV;
+typedef struct { double x, y; } PJ_XY;
+typedef struct { double lam, phi; } PJ_LP;
+
+typedef struct { double x, y, z; } PJ_XYZ;
+typedef struct { double u, v, w; } PJ_UVW;
+typedef struct { double lam, phi, z; } PJ_LPZ;
/* Avoid preprocessor renaming and implicit type-punning: Use a union to make it explicit */
@@ -229,12 +229,12 @@ union PJ_COORD {
PJ_LPZT lpzt;
PJ_OPK opk;
PJ_ENU enu;
- XYZ xyz;
- UVW uvw;
- LPZ lpz;
- XY xy;
- UV uv;
- LP lp;
+ PJ_XYZ xyz;
+ PJ_UVW uvw;
+ PJ_LPZ lpz;
+ PJ_XY xy;
+ PJ_UV uv;
+ PJ_LP lp;
};
@@ -263,8 +263,8 @@ struct PJ_GRID_INFO {
char gridname[32]; /* name of grid */
char filename[260]; /* full path to grid */
char format[8]; /* file format of grid */
- LP lowerleft; /* Coordinates of lower left corner */
- LP upperright; /* Coordinates of upper right corner */
+ PJ_LP lowerleft; /* Coordinates of lower left corner */
+ PJ_LP upperright; /* Coordinates of upper right corner */
int n_lon, n_lat; /* Grid size */
double cs_lon, cs_lat; /* Cell size of grid */
};
@@ -336,16 +336,16 @@ PJ_COORD proj_coord (double x, double y,
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, LP a, LP b);
+double proj_lp_dist (const PJ *P, PJ_LP a, PJ_LP b);
/* The geodesic distance AND the vertical offset */
-double proj_lpz_dist (const PJ *P, LPZ a, LPZ b);
+double proj_lpz_dist (const PJ *P, PJ_LPZ a, PJ_LPZ b);
/* Euclidean distance between two points with linear 2D coordinates */
-double proj_xy_dist (XY a, XY b);
+double proj_xy_dist (PJ_XY a, PJ_XY b);
/* Euclidean distance between two points with linear 3D coordinates */
-double proj_xyz_dist (XYZ a, XYZ b);
+double proj_xyz_dist (PJ_XYZ a, PJ_XYZ b);
/* Set or read error level */
@@ -355,7 +355,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, LP lp);
+PJ_FACTORS proj_factors(PJ *P, PJ_LP lp);
/* Info functions - get information about various PROJ.4 entities */
PJ_INFO proj_info(void);
--- a/src/proj_internal.h
+++ b/src/proj_internal.h
@@ -91,9 +91,9 @@ PJ_COORD pj_approx_3D_trans (PJ *P, PJ_D
/* Grid functionality */
int proj_vgrid_init(PJ *P, const char *grids);
int proj_hgrid_init(PJ *P, const char *grids);
-double proj_vgrid_value(PJ *P, LP lp);
-LP proj_hgrid_value(PJ *P, LP lp);
-LP proj_hgrid_apply(PJ *P, LP lp, PJ_DIRECTION direction);
+double proj_vgrid_value(PJ *P, PJ_LP lp);
+PJ_LP proj_hgrid_value(PJ *P, PJ_LP lp);
+PJ_LP proj_hgrid_apply(PJ *P, PJ_LP lp, PJ_DIRECTION direction);
/* High level functionality for handling thread contexts */
enum proj_log_level {
--- a/src/projects.h
+++ b/src/projects.h
@@ -157,10 +157,6 @@ typedef struct { double u, v, w; } projU
#define XYZ projUVW
#define LPZ projUVW
-/* Yes, this is ridiculous, but a consequence of an old and bad decision about implicit type-punning through preprocessor abuse */
-typedef struct { double u, v; } UV;
-typedef struct { double u, v, w; } UVW;
-
#else
typedef struct { double x, y; } XY;
typedef struct { double x, y, z; } XYZ;
@@ -169,6 +165,15 @@ typedef struct { double lam, phi, z; } L
typedef struct { double u, v; } UV;
typedef struct { double u, v, w; } UVW;
#endif /* ndef PJ_LIB__ */
+
+#else
+typedef PJ_XY XY;
+typedef PJ_LP LP;
+typedef PJ_UV UV;
+typedef PJ_XYZ XYZ;
+typedef PJ_LPZ LPZ;
+typedef PJ_UVW UVW;
+
#endif /* ndef PROJ_H */
From 8ac00a13f4b78ee5c888617e29158fc774f54dc3 Mon Sep 17 00:00:00 2001
From: Kristian Evers <kristianevers@gmail.com>
Date: Thu, 8 Feb 2018 14:26:29 +0100
Subject: [PATCH] Trying to fix #778 by using doubles in robin and relaxing
tolerances in a few tests
---
nad/testvarious | 4 +--
nad/tv_out.dist | 20 ++++++-------
src/PJ_robin.c | 80 +++++++++++++++++++++++++--------------------------
test/gie/builtins.gie | 20 +++++++------
4 files changed, 63 insertions(+), 61 deletions(-)
--- a/nad/testvarious
+++ b/nad/testvarious
@@ -782,11 +782,11 @@ EOF
echo "##############################################################" >> ${OUT}
echo "Test SCH inverse projection" >> ${OUT}
#
-$EXE -f '%.7f' \
+$EXE -f '%.6f' \
+proj=sch +datum=WGS84 +plat_0=30.0 +plon_0=45.0 +phdg_0=-12.0 +nodefs +to \
+proj=latlong +datum=WGS84 \
-E >> ${OUT} <<EOF
-0. 0.
+0. 0. 2.
0. 1000.
1000. 0.
1000. 1000.
--- a/nad/tv_out.dist
+++ b/nad/tv_out.dist
@@ -85,12 +85,12 @@ Test transverse mercator inverse (#97)
15d4'42.357"E 14d48'56.372"N 0.000 3999967.33 1999855.31 0.00
##############################################################
Test robinson projection (#113)
--30 40 -2612095.95 4276351.58 0.00
--35 45 -2963455.42 4805073.65 0.00
-20 40 1741397.30 4276351.58 0.00
--2612095.95 4276351.58 0.00 30d0'0.004"W 40d0'0.066"N 0.000
--2963455.42 4805073.65 0.00 35dW 45dN 0.000
-1741397.30 4276351.58 0.00 20d0'0.002"E 40d0'0.066"N 0.000
+-30 40 -2612096.00 4276351.68 0.00
+-35 45 -2963455.41 4805073.66 0.00
+20 40 1741397.33 4276351.68 0.00
+-2612095.95 4276351.58 0.00 30d0'0.006"W 40d0'0.063"N 0.000
+-2963455.42 4805073.65 0.00 34d59'59.989"W 44d59'59.946"N 0.000
+1741397.30 4276351.58 0.00 20d0'0.004"E 40d0'0.063"N 0.000
##############################################################
Test hammer projection (pull request #329)
-30 40 -2711575.08 4395506.62 0.00
@@ -389,10 +389,10 @@ Test SCH forward projection
30.0 45.0 1974596.2356203 787409.8217445 773.0028577
##############################################################
Test SCH inverse projection
-0. 0. 45.0000000 30.0000000 0.0000000
-0. 1000. 44.9898625 29.9981240 -0.0003617
-1000. 0. 44.9978450 30.0088238 -0.0000000
-1000. 1000. 44.9877066 30.0069477 -0.0005228
+0. 0. 2. 45.000000 30.000000 2.000000
+0. 1000. 44.989863 29.998124 -0.000362
+1000. 0. 44.997845 30.008824 -0.000000
+1000. 1000. 44.987707 30.006948 -0.000523
##############################################################
Test issue #316 (switch utm to use etmerc)
0 83 145723.870553 9300924.845226 0.000000
--- a/src/PJ_robin.c
+++ b/src/PJ_robin.c
@@ -17,51 +17,51 @@ http://trac.osgeo.org/proj/ticket/113
*/
struct COEFS {
- float c0, c1, c2, c3;
+ double c0, c1, c2, c3;
};
static const struct COEFS X[] = {
- {1.0f, 2.2199e-17f, -7.15515e-05f, 3.1103e-06f},
- {0.9986f, -0.000482243f, -2.4897e-05f, -1.3309e-06f},
- {0.9954f, -0.00083103f, -4.48605e-05f, -9.86701e-07f},
- {0.99f, -0.00135364f, -5.9661e-05f, 3.6777e-06f},
- {0.9822f, -0.00167442f, -4.49547e-06f, -5.72411e-06f},
- {0.973f, -0.00214868f, -9.03571e-05f, 1.8736e-08f},
- {0.96f, -0.00305085f, -9.00761e-05f, 1.64917e-06f},
- {0.9427f, -0.00382792f, -6.53386e-05f, -2.6154e-06f},
- {0.9216f, -0.00467746f, -0.00010457f, 4.81243e-06f},
- {0.8962f, -0.00536223f, -3.23831e-05f, -5.43432e-06f},
- {0.8679f, -0.00609363f, -0.000113898f, 3.32484e-06f},
- {0.835f, -0.00698325f, -6.40253e-05f, 9.34959e-07f},
- {0.7986f, -0.00755338f, -5.00009e-05f, 9.35324e-07f},
- {0.7597f, -0.00798324f, -3.5971e-05f, -2.27626e-06f},
- {0.7186f, -0.00851367f, -7.01149e-05f, -8.6303e-06f},
- {0.6732f, -0.00986209f, -0.000199569f, 1.91974e-05f},
- {0.6213f, -0.010418f, 8.83923e-05f, 6.24051e-06f},
- {0.5722f, -0.00906601f, 0.000182f, 6.24051e-06f},
- {0.5322f, -0.00677797f, 0.000275608f, 6.24051e-06f}
+ {1.0, 2.2199e-17, -7.15515e-05, 3.1103e-06},
+ {0.9986, -0.000482243, -2.4897e-05, -1.3309e-06},
+ {0.9954, -0.00083103, -4.48605e-05, -9.86701e-07},
+ {0.99, -0.00135364, -5.9661e-05, 3.6777e-06},
+ {0.9822, -0.00167442, -4.49547e-06, -5.72411e-06},
+ {0.973, -0.00214868, -9.03571e-05, 1.8736e-08},
+ {0.96, -0.00305085, -9.00761e-05, 1.64917e-06},
+ {0.9427, -0.00382792, -6.53386e-05, -2.6154e-06},
+ {0.9216, -0.00467746, -0.00010457, 4.81243e-06},
+ {0.8962, -0.00536223, -3.23831e-05, -5.43432e-06},
+ {0.8679, -0.00609363, -0.000113898, 3.32484e-06},
+ {0.835, -0.00698325, -6.40253e-05, 9.34959e-07},
+ {0.7986, -0.00755338, -5.00009e-05, 9.35324e-07},
+ {0.7597, -0.00798324, -3.5971e-05, -2.27626e-06},
+ {0.7186, -0.00851367, -7.01149e-05, -8.6303e-06},
+ {0.6732, -0.00986209, -0.000199569, 1.91974e-05},
+ {0.6213, -0.010418, 8.83923e-05, 6.24051e-06},
+ {0.5722, -0.00906601, 0.000182, 6.24051e-06},
+ {0.5322, -0.00677797, 0.000275608, 6.24051e-06}
};
static const struct COEFS Y[] = {
- {-5.20417e-18f, 0.0124f, 1.21431e-18f, -8.45284e-11f},
- {0.062f, 0.0124f, -1.26793e-09f, 4.22642e-10f},
- {0.124f, 0.0124f, 5.07171e-09f, -1.60604e-09f},
- {0.186f, 0.0123999f, -1.90189e-08f, 6.00152e-09f},
- {0.248f, 0.0124002f, 7.10039e-08f, -2.24e-08f},
- {0.31f, 0.0123992f, -2.64997e-07f, 8.35986e-08f},
- {0.372f, 0.0124029f, 9.88983e-07f, -3.11994e-07f},
- {0.434f, 0.0123893f, -3.69093e-06f, -4.35621e-07f},
- {0.4958f, 0.0123198f, -1.02252e-05f, -3.45523e-07f},
- {0.5571f, 0.0121916f, -1.54081e-05f, -5.82288e-07f},
- {0.6176f, 0.0119938f, -2.41424e-05f, -5.25327e-07f},
- {0.6769f, 0.011713f, -3.20223e-05f, -5.16405e-07f},
- {0.7346f, 0.0113541f, -3.97684e-05f, -6.09052e-07f},
- {0.7903f, 0.0109107f, -4.89042e-05f, -1.04739e-06f},
- {0.8435f, 0.0103431f, -6.4615e-05f, -1.40374e-09f},
- {0.8936f, 0.00969686f, -6.4636e-05f, -8.547e-06f},
- {0.9394f, 0.00840947f, -0.000192841f, -4.2106e-06f},
- {0.9761f, 0.00616527f, -0.000256f, -4.2106e-06f},
- {1.0f, 0.00328947f, -0.000319159f, -4.2106e-06f}
+ {-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11},
+ {0.062, 0.0124, -1.26793e-09, 4.22642e-10},
+ {0.124, 0.0124, 5.07171e-09, -1.60604e-09},
+ {0.186, 0.0123999, -1.90189e-08, 6.00152e-09},
+ {0.248, 0.0124002, 7.10039e-08, -2.24e-08},
+ {0.31, 0.0123992, -2.64997e-07, 8.35986e-08},
+ {0.372, 0.0124029, 9.88983e-07, -3.11994e-07},
+ {0.434, 0.0123893, -3.69093e-06, -4.35621e-07},
+ {0.4958, 0.0123198, -1.02252e-05, -3.45523e-07},
+ {0.5571, 0.0121916, -1.54081e-05, -5.82288e-07},
+ {0.6176, 0.0119938, -2.41424e-05, -5.25327e-07},
+ {0.6769, 0.011713, -3.20223e-05, -5.16405e-07},
+ {0.7346, 0.0113541, -3.97684e-05, -6.09052e-07},
+ {0.7903, 0.0109107, -4.89042e-05, -1.04739e-06},
+ {0.8435, 0.0103431, -6.4615e-05, -1.40374e-09},
+ {0.8936, 0.00969686, -6.4636e-05, -8.547e-06},
+ {0.9394, 0.00840947, -0.000192841, -4.2106e-06},
+ {0.9761, 0.00616527, -0.000256, -4.2106e-06},
+ {1.0, 0.00328947, -0.000319159, -4.2106e-06}
};
#define FXC 0.8487
@@ -129,7 +129,7 @@ static LP s_inverse (XY xy, PJ *P) {
/* first guess, linear interp */
t = 5. * (lp.phi - T.c0)/(Y[i+1].c0 - T.c0);
/* make into root */
- T.c0 = (float)(T.c0 - lp.phi);
+ T.c0 = (T.c0 - lp.phi);
for (iters = MAX_ITER; iters ; --iters) { /* Newton-Raphson */
t -= t1 = V(T,t) / DV(T,t);
if (fabs(t1) < EPS)
--- a/test/gie/builtins.gie
+++ b/test/gie/builtins.gie
@@ -627,7 +627,8 @@ Chamberlin Trimetric
-------------------------------------------------------------------------------
operation +proj=chamb +R=6400000 +lat_1=0.5 +lat_2=2
-------------------------------------------------------------------------------
-tolerance 0.00010 mm
+# Relaxed tolerance as a guard against numerical instability on non-amd64 systems
+tolerance 0.5 mm
accept 2 1
expect -27864.779586801 -223364.324593274
accept 2 -1
@@ -3585,15 +3586,15 @@ Robinson
-------------------------------------------------------------------------------
operation +proj=robin +a=6400000 +lat_1=0.5 +lat_2=2
-------------------------------------------------------------------------------
-tolerance 0.00010 mm
-accept 2 1
-expect 189588.423282508 107318.530350703
-accept 2 -1
-expect 189588.423282508 -107318.530350703
+tolerance 0.0001 m
+accept 2 1
+expect 189588.4233 107318.5273
+accept 2 -1
+expect 189588.4233 -107318.5273
accept -2 1
-expect -189588.423282508 107318.530350703
+expect -189588.4233 107318.5273
accept -2 -1
-expect -189588.423282508 -107318.530350703
+expect -189588.4233 -107318.5273
direction inverse
accept 200 100
@@ -4315,7 +4316,8 @@ van der Grinten II
-------------------------------------------------------------------------------
operation +proj=vandg2 +a=6400000 +lat_1=0.5 +lat_2=2
-------------------------------------------------------------------------------
-tolerance 0.00010 mm
+# Relaxed tolerance as a guard against numerical instability on non-amd64 systems
+tolerance 0.5 mm
accept 2 1
expect 223395.247850437 111718.491037226
accept 2 -1
Description: Fix manpage section for pj_init.
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: https://github.com/OSGeo/proj.4/pull/777
Applied-Upstream: https://github.com/OSGeo/proj.4/commit/47758e367f8414019365173691e6456411ee8a57
--- a/man/man3/pj_init.3
+++ b/man/man3/pj_init.3
@@ -1,6 +1,6 @@
.\" @(#)pj_init.3 - 5.0.0
.\"
-.TH PJ_INIT 3U "2018/02/15 Rel. 5.0.0"
+.TH PJ_INIT 3 "2018/02/15 Rel. 5.0.0"
.ad b
.hy 1
.SH NAME
manpage-section.patch
avoid-numerical-differences-on-non-amd64-architectures.patch
0001-Avoid-XY-LP-and-UV-datatype-clashes-with-other-libra.patch
0001-Add-missing-in-boolean-evaluation.-Fixes-780.patch
.\" @(#)pj_init.3 - 5.0.0
.\"
.TH PJ_INIT 3U "2018/02/15 Rel. 5.0.0"
.TH PJ_INIT 3 "2018/02/15 Rel. 5.0.0"
.ad b
.hy 1
.SH NAME
......
......@@ -70,3 +70,7 @@ WO.lla.Z --- Washington, Oregon, N. California
Other grid shift files
ntv1_can.dat --- Canadian NTv1 grid shift file (NAD27-->NAD83)
ntf_r93.gsb --- French NTv2 grid shift file (NTF-->RGF93)
BETA2007.gsb --- German NTv2 grid shift file (DE_DHDN-->ETRS89) :
http://crs.bkg.bund.de/crseu/crs/descrtrans/BeTA/de_dhdn2etrs_beta.php
Confirmed with Uwe Schmitz <uwe.schmitz@bezreg-koeln.nrw.de> that free
redistribution is allowed and welcome.
......@@ -782,11 +782,11 @@ EOF
echo "##############################################################" >> ${OUT}
echo "Test SCH inverse projection" >> ${OUT}
#
$EXE -f '%.7f' \
$EXE -f '%.6f' \
+proj=sch +datum=WGS84 +plat_0=30.0 +plon_0=45.0 +phdg_0=-12.0 +nodefs +to \
+proj=latlong +datum=WGS84 \
-E >> ${OUT} <<EOF
0. 0.
0. 0. 2.
0. 1000.
1000. 0.
1000. 1000.
......
......@@ -389,10 +389,10 @@ Test SCH forward projection
30.0 45.0 1974596.2356203 787409.8217445 773.0028577
##############################################################
Test SCH inverse projection
0. 0. 45.0000000 30.0000000 0.0000000
0. 1000. 44.9898625 29.9981240 -0.0003617
1000. 0. 44.9978450 30.0088238 -0.0000000
1000. 1000. 44.9877066 30.0069477 -0.0005228
0. 0. 2. 45.000000 30.000000 2.000000
0. 1000. 44.989863 29.998124 -0.000362
1000. 0. 44.997845 30.008824 -0.000000
1000. 1000. 44.987707 30.006948 -0.000523
##############################################################
Test issue #316 (switch utm to use etmerc)
0 83 145723.870553 9300924.845226 0.000000
......
......@@ -240,11 +240,13 @@ static PJ *pj_create_pipeline (PJ *P, size_t steps) {
/* count the number of args in pipeline definition */
/* count the number of args in pipeline definition, and mark all args as used */
static size_t argc_params (paralist *params) {
size_t argc = 0;
for (; params != 0; params = params->next)
for (; params != 0; params = params->next) {
argc++;
params->used = 1;
}
return ++argc; /* one extra for the sentinel */
}
......@@ -414,7 +416,7 @@ PJ *OPERATION(pipeline,0) {
err = proj_errno_reset (P);
next_step = proj_create_argv (P->ctx, current_argc, current_argv);
proj_log_trace (P, "Pipeline: Step %d at %p", i, next_step);
proj_log_trace (P, "Pipeline: Step %d (%s) at %p", i, current_argv[0], next_step);
if (0==next_step) {
/* The step init failed, but possibly without setting errno. If so, we say "malformed" */
......@@ -436,7 +438,7 @@ PJ *OPERATION(pipeline,0) {
P->opaque->pipeline[i+1] = next_step;
proj_log_trace (P, "Pipeline at [%p]: step at [%p] done", P, next_step);
proj_log_trace (P, "Pipeline at [%p]: step at [%p] (%s) done", P, next_step, current_argv[0]);
}
/* Require a forward path through the pipeline */
......
......@@ -151,6 +151,7 @@ static const char usage[] = {
int main(int argc, char **argv) {
PJ *P;
PJ_COORD point;
PJ_PROJ_INFO info;
OPTARGS *o;
FILE *fout = stdout;
char *buf;
......@@ -222,6 +223,11 @@ int main(int argc, char **argv) {
return 1;
}
if (verbose > 4) {
info = proj_pj_info (P);
fprintf (stdout, "Final: %s argc=%d pargc=%d\n", info.definition, argc, o->pargc);
}
if (direction==-1) {
/* fail if an inverse operation is not available */
if (!proj_pj_info(P).has_inverse) {
......
......@@ -681,7 +681,7 @@ back/forward transformation pairs.
banner (T.operation);
fprintf (T.fout, "%s", T.op_ko? " -----\n": delim);
fprintf (T.fout, " FAILURE in %s(%d):\n", opt_strip_path (T.curr_file), (int) F->lineno);
fprintf (T.fout, " roundtrip deviation: %.3f mm, expected: %.3f mm\n", 1000*r, 1000*d);
fprintf (T.fout, " roundtrip deviation: %.6f mm, expected: %.6f mm\n", 1000*r, 1000*d);
}
return another_failure ();
}
......@@ -700,13 +700,13 @@ static int expect_message (double d, const char *args) {
fprintf (T.fout, " FAILURE in %s(%d):\n", opt_strip_path (T.curr_file), (int) F->lineno);
fprintf (T.fout, " expected: %s\n", args);
fprintf (T.fout, " got: %.9f %.9f", T.b.xy.x, T.b.xy.y);
fprintf (T.fout, " got: %.12f %.12f", T.b.xy.x, T.b.xy.y);
if (T.b.xyzt.t!=0 || T.b.xyzt.z!=0)
fprintf (T.fout, " %.9f", T.b.xyz.z);
if (T.b.xyzt.t!=0)
fprintf (T.fout, " %.9f", T.b.xyzt.t);
fprintf (T.fout, "\n");
fprintf (T.fout, " deviation: %.3f mm, expected: %.3f mm\n", 1000*d, 1000*T.tolerance);
fprintf (T.fout, " deviation: %.6f mm, expected: %.6f mm\n", 1000*d, 1000*T.tolerance);
return 1;
}
......@@ -829,42 +829,35 @@ Tell GIE what to expect, when transforming the ACCEPTed input
/* expected angular values, probably in degrees */
ce = proj_angular_output (T.P, T.dir)? torad_coord (T.P, T.dir, T.e): T.e;
if (T.verbosity > 3)
printf ("EXPECTS %.4f %.4f %.4f %.4f\n", ce.v[0],ce.v[1],ce.v[2],ce.v[3]);
printf ("EXPECTS %.12f %.12f %.12f %.12f\n", ce.v[0],ce.v[1],ce.v[2],ce.v[3]);
/* input ("accepted") values, also probably in degrees */
ci = proj_angular_input (T.P, T.dir)? torad_coord (T.P, T.dir, T.a): T.a;
if (T.verbosity > 3)
printf ("ACCEPTS %.4f %.4f %.4f %.4f\n", ci.v[0],ci.v[1],ci.v[2],ci.v[3]);
printf ("ACCEPTS %.12f %.12f %.12f %.12f\n", ci.v[0],ci.v[1],ci.v[2],ci.v[3]);
/* angular output from proj_trans comes in radians */
co = expect_trans_n_dim (ci);
T.b = proj_angular_output (T.P, T.dir)? todeg_coord (T.P, T.dir, co): co;
if (T.verbosity > 3)
printf ("GOT %.4f %.4f %.4f %.4f\n", co.v[0],co.v[1],co.v[2],co.v[3]);
printf ("GOT %.12f %.12f %.12f %.12f\n", co.v[0],co.v[1],co.v[2],co.v[3]);
/* but there are a few more possible input conventions... */
if (proj_angular_output (T.P, T.dir)) {
double e = HUGE_VAL;
d = proj_lpz_dist (T.P, ce.lpz, co.lpz);
/* check whether input was already in radians */
if (d > T.tolerance)
e = proj_lpz_dist (T.P, T.e.lpz, co.lpz);
if (e < d)
d = e;
/* or the tolerance may be based on euclidean distance */
if (d > T.tolerance)
e = proj_xyz_dist (T.b.xyz, T.e.xyz);
if (e < d)
d = e;
#if 0
/* We need to handle unusual axis orders - that'll be an item for version 5.1 */
if (T.P->axisswap) {
ce = proj_trans (T.P->axisswap, T.dir, ce);
co = proj_trans (T.P->axisswap, T.dir, co);
}
#endif
if (proj_angular_output (T.P, T.dir))
d = proj_lpz_dist (T.P, ce, co);
else
d = proj_xyz_dist (T.b.xyz, T.e.xyz);
d = proj_xyz_dist (co, ce);
if (d > T.tolerance)
return expect_message (d, args);
another_success ();
return 0;
}
......@@ -1439,13 +1432,13 @@ static int pj_horner_selftest (void) {
/* Forward projection */
b = proj_trans (P, PJ_FWD, a);
dist = proj_xy_dist (b.xy, c.xy);
dist = proj_xy_dist (b, c);
if (dist > 0.001)
return 2;
/* Inverse projection */
b = proj_trans (P, PJ_INV, c);
dist = proj_xy_dist (b.xy, a.xy);
dist = proj_xy_dist (b, a);
if (dist > 0.001)
return 3;
......@@ -1527,7 +1520,7 @@ static int pj_cart_selftest (void) {
/* Forward again, to get two linear items for comparison */
a = proj_trans (P, PJ_FWD, a);
dist = proj_xy_dist (a.xy, b.xy);
dist = proj_xy_dist (a, b);
if (dist > 2e-9)
return 3;
......@@ -1778,7 +1771,7 @@ static int pj_cart_selftest (void) {
a.lp.lam = PJ_TORAD(12);
a.lp.phi = PJ_TORAD(55);
factors = proj_factors(P, a.lp);
factors = proj_factors(P, a);
if (proj_errno(P))
return 85; /* factors not created correctly */
......@@ -1843,12 +1836,12 @@ static int pj_cart_selftest (void) {
/* linear in and out */
P = proj_create(PJ_DEFAULT_CTX,
" +proj=helmert +ellps=GRS80"
" +proj=helmert"
" +x=0.0127 +y=0.0065 +z=-0.0209 +s=0.00195"
" +rx=-0.00039 +ry=0.00080 +rz=-0.00114"
" +dx=-0.0029 +dy=-0.0002 +dz=-0.0006 +ds=0.00001"
" +drx=-0.00011 +dry=-0.00019 +drz=0.00007"
" +t_epoch=1988.0 +transpose"
" +t_epoch=1988.0 +transpose +no_defs"
);
if (0==P) return 0;
if (proj_angular_input (P, PJ_FWD)) return 116;
......@@ -1860,8 +1853,12 @@ static int pj_cart_selftest (void) {
if (proj_angular_input (P, PJ_INV)) return 121;
if (proj_angular_output (P, PJ_FWD)) return 122;
if (proj_angular_output (P, PJ_INV)) return 123;
proj_destroy(P);
/* We specified "no_defs" but didn't give any ellipsoid info */
/* pj_init_ctx should defualt to WGS84 */
if (P->a != 6378137.0) return 124;
if (P->f != 1.0/298.257223563) return 125;
proj_destroy(P);
return 0;
}
......@@ -1869,9 +1866,6 @@ static int pj_cart_selftest (void) {
static int test_time(const char* args, double tol, double t_in, double t_exp) {
PJ_COORD in, out;
PJ *P = proj_create(PJ_DEFAULT_CTX, args);
......
......@@ -284,6 +284,10 @@ add_library( ${PROJ_CORE_TARGET}
${ALL_LIBPROJ_HEADERS}
${PROJ_RESOURCES} )
if (NOT CMAKE_VERSION VERSION_LESS 2.8.11)
target_include_directories (${PROJ_CORE_TARGET} INTERFACE
$<INSTALL_INTERFACE:${INCLUDEDIR}>)
endif ()
if(WIN32)
set_target_properties(${PROJ_CORE_TARGET}
......
......@@ -47,7 +47,8 @@ C_NAMESPACE_VAR const struct PJ_DATUMS pj_datums[] = {
{"NAD27", "nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",
"clrk66",
"North_American_Datum_1927"},
{"potsdam", "towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7",
{"potsdam", /*"towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7",*/
"nadgrids=@BETA2007.gsb",
"bessel",
"Potsdam Rauenberg 1950 DHDN"},
{"carthage","towgs84=-263.0,6.0,431.0", "clrk80ign",
......
......@@ -73,11 +73,13 @@ static PJ_COORD pj_fwd_prepare (PJ *P, PJ_COORD coo) {
coo = proj_trans (P->hgridshift, PJ_INV, coo);
else if (P->helmert) {
coo = proj_trans (P->cart_wgs84, PJ_FWD, coo); /* Go cartesian in WGS84 frame */
coo = proj_trans (P->helmert, PJ_FWD, coo); /* Step into local frame */
coo = proj_trans (P->helmert, PJ_INV, coo); /* Step into local frame */
coo = proj_trans (P->cart, PJ_INV, coo); /* Go back to angular using local ellps */
}
if (coo.lp.lam==HUGE_VAL)
return coo;
if (P->vgridshift)
coo = proj_trans (P->vgridshift, PJ_FWD, coo);
coo = proj_trans (P->vgridshift, PJ_FWD, coo); /* Go orthometric from geometric */
/* Distance from central meridian, taking system zero meridian into account */
coo.lp.lam = (coo.lp.lam - P->from_greenwich) - P->lam0;
......@@ -92,7 +94,7 @@ static PJ_COORD pj_fwd_prepare (PJ *P, PJ_COORD coo) {
/* We do not support gridshifts on cartesian input */
if (INPUT_UNITS==PJ_IO_UNITS_CARTESIAN && P->helmert)
return proj_trans (P->helmert, PJ_FWD, coo);
return proj_trans (P->helmert, PJ_INV, coo);
return coo;
}
......@@ -139,14 +141,18 @@ static PJ_COORD pj_fwd_finalize (PJ *P, PJ_COORD coo) {
coo.lpz.lam = adjlon(coo.lpz.lam);
if (P->vgridshift)
coo = proj_trans (P->vgridshift, PJ_INV, coo);
coo = proj_trans (P->vgridshift, PJ_FWD, coo); /* Go orthometric from geometric */
if (coo.lp.lam==HUGE_VAL)
return coo;
if (P->hgridshift)
coo = proj_trans (P->hgridshift, PJ_FWD, coo);
coo = proj_trans (P->hgridshift, PJ_INV, coo);
else if (P->helmert) {
coo = proj_trans (P->cart_wgs84, PJ_FWD, coo); /* Go cartesian in WGS84 frame */
coo = proj_trans (P->helmert, PJ_FWD, coo); /* Step into local frame */
coo = proj_trans (P->helmert, PJ_INV, coo); /* Step into local frame */
coo = proj_trans (P->cart, PJ_INV, coo); /* Go back to angular using local ellps */
}
if (coo.lp.lam==HUGE_VAL)
return coo;
/* If input latitude was geocentrical, convert back to geocentrical */
if (P->geoc)
......
......@@ -48,7 +48,7 @@ static LP inverse(XY xy, PJ *P) {
return lp;
}
PJ *PROJECTION(geocent) {
PJ *CONVERSION (geocent, 0) {
P->is_geocent = 1;
P->x0 = 0.0;
P->y0 = 0.0;
......