aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2017-07-12 10:42:44 +0200
committerKristian Evers <kristianevers@gmail.com>2017-07-13 12:20:03 +0200
commit8731336c9101b1948b401e0b0d8149598d56fa90 (patch)
treec164f977940d6b1fcbb571dcf7ed69c908c25009 /src
parent608c7c6f568cab02abcebcbc162db47dfdb6da8a (diff)
downloadPROJ-8731336c9101b1948b401e0b0d8149598d56fa90.tar.gz
PROJ-8731336c9101b1948b401e0b0d8149598d56fa90.zip
Implemented proj_obs()
Diffstat (limited to 'src')
-rw-r--r--src/pj_obs_api.c20
-rw-r--r--src/proj.h4
2 files changed, 21 insertions, 3 deletions
diff --git a/src/pj_obs_api.c b/src/pj_obs_api.c
index e52d9c1c..1b353b46 100644
--- a/src/pj_obs_api.c
+++ b/src/pj_obs_api.c
@@ -42,6 +42,7 @@
#include <errno.h>
+/* Initialize PJ_COORD struct */
PJ_COORD proj_coord (double x, double y, double z, double t) {
PJ_COORD res;
res.v[0] = x;
@@ -51,6 +52,24 @@ PJ_COORD proj_coord (double x, double y, double z, double t) {
return res;
}
+/* Initialize PJ_OBS struct */
+PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, double k, int id, unsigned int flags) {
+ PJ_OBS res;
+ res.coo.v[0] = x;
+ res.coo.v[1] = y;
+ res.coo.v[2] = z;
+ res.coo.v[3] = t;
+ res.anc.v[0] = o;
+ res.anc.v[1] = p;
+ res.anc.v[2] = k;
+ res.id = id;
+ res.flags = flags;
+
+ return res;
+}
+
+
+
/* Geodesic distance between two points with angular 2D coordinates */
double proj_lp_dist (PJ *P, LP a, LP b) {
double s12, azi1, azi2;
@@ -476,4 +495,3 @@ double proj_todeg (double angle_in_radians) { return PJ_TODEG (angle_in_radians)
int proj_transform_obs (PJ *P, enum proj_direction direction, size_t n, PJ_OBS *obs);
int proj_transform_coord (PJ *P, enum proj_direction direction, size_t n, PJ_COORD *coord);
-PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, double k, int id, unsigned int flags);
diff --git a/src/proj.h b/src/proj.h
index b5a659d4..d15a798f 100644
--- a/src/proj.h
+++ b/src/proj.h
@@ -312,9 +312,9 @@ size_t proj_transform (
);
-/* not a constructor, but an initializer */
+/* Initializers */
PJ_COORD proj_coord (double x, double y, double z, double t);
-
+PJ_OBS proj_obs (double x, double y, double z, double t, double o, double p, double k, int id, unsigned int flags);
/* Measure internal consistency - in forward or inverse direction */
double proj_roundtrip (PJ *P, enum proj_direction direction, int n, PJ_OBS obs);