aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2017-10-21 02:34:10 +0200
committerGitHub <noreply@github.com>2017-10-21 02:34:10 +0200
commit05eed057d109f650b41c6abf3dd3574a346aec10 (patch)
treef6c233a76e5c5b9e94d562dfed2f4c130093dcc9
parent9311b85611ad78158dfc62098e96e45930b5d825 (diff)
downloadPROJ-05eed057d109f650b41c6abf3dd3574a346aec10.tar.gz
PROJ-05eed057d109f650b41c6abf3dd3574a346aec10.zip
Make sure units of latlong operations are treated correctly (#620)
Added 4D fwd/inv functions and unit descriptors to the latlong PJ object to work properly in pipelines.
-rw-r--r--src/PJ_latlong.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/PJ_latlong.c b/src/PJ_latlong.c
index dec69b70..1677142a 100644
--- a/src/PJ_latlong.c
+++ b/src/PJ_latlong.c
@@ -29,7 +29,8 @@
/* very loosely based upon DMA code by Bradford W. Drew */
#define PJ_LIB__
-#include <projects.h>
+#include <proj.h>
+#include "projects.h"
PROJ_HEAD(lonlat, "Lat/long (Geodetic)") "\n\t";
PROJ_HEAD(latlon, "Lat/long (Geodetic alias)") "\n\t";
@@ -52,6 +53,15 @@ static LP inverse(XY xy, PJ *P) {
return lp;
}
+static PJ_OBS forward_obs(PJ_OBS obs, PJ *P) {
+ (void) P;
+ return obs;
+}
+
+static PJ_OBS inverse_obs(PJ_OBS obs, PJ *P) {
+ (void) P;
+ return obs;
+}
PJ *PROJECTION(latlong) {
P->is_latlong = 1;
@@ -59,6 +69,10 @@ PJ *PROJECTION(latlong) {
P->y0 = 0.0;
P->inv = inverse;
P->fwd = forward;
+ P->invobs = inverse_obs;
+ P->fwdobs = forward_obs;
+ P->left = PJ_IO_UNITS_RADIANS;
+ P->right = PJ_IO_UNITS_RADIANS;
return P;
}
@@ -70,6 +84,10 @@ PJ *PROJECTION(longlat) {
P->y0 = 0.0;
P->inv = inverse;
P->fwd = forward;
+ P->invobs = inverse_obs;
+ P->fwdobs = forward_obs;
+ P->left = PJ_IO_UNITS_RADIANS;
+ P->right = PJ_IO_UNITS_RADIANS;
return P;
}
@@ -81,6 +99,10 @@ PJ *PROJECTION(latlon) {
P->y0 = 0.0;
P->inv = inverse;
P->fwd = forward;
+ P->invobs = inverse_obs;
+ P->fwdobs = forward_obs;
+ P->left = PJ_IO_UNITS_RADIANS;
+ P->right = PJ_IO_UNITS_RADIANS;
return P;
}
@@ -90,7 +112,12 @@ PJ *PROJECTION(lonlat) {
P->is_latlong = 1;
P->x0 = 0.0;
P->y0 = 0.0;
- P->inv = inverse; P->fwd = forward;
+ P->inv = inverse;
+ P->fwd = forward;
+ P->invobs = inverse_obs;
+ P->fwdobs = forward_obs;
+ P->left = PJ_IO_UNITS_RADIANS;
+ P->right = PJ_IO_UNITS_RADIANS;
return P;
}