aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2018-02-01 16:09:49 +0100
committerGitHub <noreply@github.com>2018-02-01 16:09:49 +0100
commitb48f7ba228c06ab53d624779e4023d83bd6c352b (patch)
treede75c4b7390e10aa768a586a8432e9bfcb0ec67c /src
parent34ebb6f7d0fefc75a1e8c0751e7ac6f9620778d3 (diff)
parent5c132e5be1a38a0ec018edcec86b3d889d6e33fa (diff)
downloadPROJ-b48f7ba228c06ab53d624779e4023d83bd6c352b.tar.gz
PROJ-b48f7ba228c06ab53d624779e4023d83bd6c352b.zip
Merge pull request #750 from busstoptaktik/return_derivs_in_factor
make local derivatives available in PJ_FACTOR
Diffstat (limited to 'src')
-rw-r--r--src/proj.h3
-rw-r--r--src/proj_4D_api.c12
2 files changed, 12 insertions, 3 deletions
diff --git a/src/proj.h b/src/proj.h
index 67c28b8d..0921eb51 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -167,6 +167,9 @@ struct P5_FACTORS { /* Common designation */
double tissot_semimajor; /* a */
double tissot_semiminor; /* b */
+
+ double dx_dlam, dx_dphi;
+ double dy_dlam, dy_dphi;
};
typedef struct P5_FACTORS PJ_FACTORS;
diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c
index 2b250398..c91b0786 100644
--- a/src/proj_4D_api.c
+++ b/src/proj_4D_api.c
@@ -940,11 +940,11 @@ PJ_FACTORS proj_factors(PJ *P, LP lp) {
Characteristics include meridian, parallel and areal scales, angular
distortion, meridian/parallel, meridian convergence and scale error.
- returns PJ_FACTORS. If unsuccessfull error number is set and the returned
- struct contains NULL data.
+ returns PJ_FACTORS. If unsuccessfull, error number is set and the
+ struct returned contains NULL data.
******************************************************************************/
- PJ_FACTORS factors = {0,0,0, 0,0,0, 0,0};
+ PJ_FACTORS factors = {0,0,0, 0,0,0, 0,0, 0,0,0,0};
struct FACTORS f;
if (0==P)
@@ -964,6 +964,12 @@ PJ_FACTORS proj_factors(PJ *P, LP lp) {
factors.tissot_semimajor = f.a;
factors.tissot_semiminor = f.b;
+ /* Raw derivatives, for completeness's sake */
+ factors.dx_dlam = f.der.x_l;
+ factors.dx_dphi = f.der.x_p;
+ factors.dy_dlam = f.der.y_l;
+ factors.dy_dphi = f.der.y_p;
+
return factors;
}