aboutsummaryrefslogtreecommitdiff
path: root/src/pj_internal.c
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2017-10-25 10:39:56 +0200
committerGitHub <noreply@github.com>2017-10-25 10:39:56 +0200
commita3fa749bc4f378d005c9e3fd809c0be25de5ffb2 (patch)
treedadf4aa7d1bf3e88478375f2d6d4e3d72eb60549 /src/pj_internal.c
parent2ad201bdb0f3408eed0aab07fe255c6ff1cd3249 (diff)
downloadPROJ-a3fa749bc4f378d005c9e3fd809c0be25de5ffb2.tar.gz
PROJ-a3fa749bc4f378d005c9e3fd809c0be25de5ffb2.zip
Remove PJ_OBS from the API surface, rename pj_obs_api.c to pj_4D_api.c (#625)
* Remove PJ_OBS from the API surface, rename pj_obs_api.c to pj_4D_api.c * Repair proj.def
Diffstat (limited to 'src/pj_internal.c')
-rw-r--r--src/pj_internal.c55
1 files changed, 47 insertions, 8 deletions
diff --git a/src/pj_internal.c b/src/pj_internal.c
index 31c299ac..5eb98afb 100644
--- a/src/pj_internal.c
+++ b/src/pj_internal.c
@@ -1,8 +1,9 @@
/******************************************************************************
* Project: PROJ.4
- * Purpose: This is primarily material originating from pj_obs_api.c,
- * that does not fit into the API category. Hence this pile of
- * tubings and fittings for PROJ.4 internal plumbing.
+ * Purpose: This is primarily material originating from pj_obs_api.c
+ * (now proj_4D_api.c), that does not fit into the API
+ * category. Hence this pile of tubings and fittings for
+ * PROJ.4 internal plumbing.
*
* Author: Thomas Knudsen, thokn@sdfe.dk, 2017-07-05
*
@@ -42,12 +43,52 @@
/* Used for zero-initializing new objects */
const PJ_COORD proj_coord_null = {{0, 0, 0, 0}};
const PJ_OBS proj_obs_null = {
- {{0, 0, 0, 0}},
- {{0, 0, 0}},
- 0, 0
+ {{0, 0, 0, 0}}
};
+
+/* Initialize PJ_OBS struct */
+PJ_OBS proj_obs (double x, double y, double z, double t) {
+ PJ_OBS res;
+ res.coo = proj_coord (x, y, z, t);
+ return res;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* Apply the transformation P to the coordinate coo */
+PJ_OBS proj_trans_obs (PJ *P, PJ_DIRECTION direction, PJ_OBS obs) {
+ if (0==P)
+ return obs;
+
+ switch (direction) {
+ case PJ_FWD:
+ return pj_fwdobs (obs, P);
+ case PJ_INV:
+ return pj_invobs (obs, P);
+ case PJ_IDENT:
+ return obs;
+ default:
+ break;
+ }
+
+ proj_errno_set (P, EINVAL);
+ return proj_obs_error ();
+}
+
+
/* Work around non-constness of MSVC HUGE_VAL by providing functions rather than constants */
PJ_COORD proj_coord_error (void) {
PJ_COORD c;
@@ -58,8 +99,6 @@ PJ_COORD proj_coord_error (void) {
PJ_OBS proj_obs_error (void) {
PJ_OBS obs;
obs.coo = proj_coord_error ();
- obs.anc.v[0] = obs.anc.v[1] = obs.anc.v[2] = HUGE_VAL;
- obs.id = obs.flags = 0;
return obs;
}