aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2017-11-05 16:51:04 +0100
committerGitHub <noreply@github.com>2017-11-05 16:51:04 +0100
commit4446aa8fbce9d31ab1bf1f9a4138b3d76cf55e84 (patch)
tree541d98268b23a169625f8945cf376a33908b23fe /src
parent98078be18bcb0d515362ecc8f122eeca0c3a4b26 (diff)
downloadPROJ-4446aa8fbce9d31ab1bf1f9a4138b3d76cf55e84.tar.gz
PROJ-4446aa8fbce9d31ab1bf1f9a4138b3d76cf55e84.zip
Improve ISO 19000 alignment (#639)
* Discern between conversions and transformations
Diffstat (limited to 'src')
-rw-r--r--src/PJ_helmert.c2
-rw-r--r--src/projects.h22
2 files changed, 20 insertions, 4 deletions
diff --git a/src/PJ_helmert.c b/src/PJ_helmert.c
index c9c30401..f49bbe97 100644
--- a/src/PJ_helmert.c
+++ b/src/PJ_helmert.c
@@ -461,7 +461,7 @@ static PJ_OBS helmert_reverse_obs (PJ_OBS point, PJ *P) {
#define ARCSEC_TO_RAD (DEG_TO_RAD / 3600.0)
/***********************************************************************/
-PJ *PROJECTION(helmert) {
+PJ *TRANSFORMATION(helmert, 0) {
/***********************************************************************/
struct pj_opaque_helmert *Q = pj_calloc (1, sizeof (struct pj_opaque_helmert));
if (0==Q)
diff --git a/src/projects.h b/src/projects.h
index a7763dd1..0631924c 100644
--- a/src/projects.h
+++ b/src/projects.h
@@ -328,6 +328,7 @@ struct PJconsts {
int geoc; /* Geocentric latitude flag */
int is_latlong; /* proj=latlong ... not really a projection at all */
int is_geocent; /* proj=geocent ... not really a projection at all */
+ int need_ellps; /* 0 for operations that are purely cartesian */
enum pj_io_units left; /* Flags for input/output coordinate types */
enum pj_io_units right;
@@ -584,12 +585,14 @@ extern struct PJ_PRIME_MERIDIANS pj_prime_meridians[];
#ifdef PJ_LIB__
#define PROJ_HEAD(id, name) static const char des_##id [] = name
-
-#define PROJECTION(name) \
+#define OPERATION(name, NEED_ELLPS) \
+ \
pj_projection_specific_setup_##name (PJ *P); \
-C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \
C_NAMESPACE PJ *pj_##name (PJ *P); \
int pj_ ## name ## _selftest (void); \
+ \
+C_NAMESPACE_VAR const char * const pj_s_##name = des_##name; \
+ \
C_NAMESPACE PJ *pj_##name (PJ *P) { \
if (P) \
return pj_projection_specific_setup_##name (P); \
@@ -598,14 +601,27 @@ C_NAMESPACE PJ *pj_##name (PJ *P) { \
return 0; \
P->destructor = pj_default_destructor; \
P->descr = des_##name; \
+ P->need_ellps = NEED_ELLPS; \
P->left = PJ_IO_UNITS_RADIANS; \
P->right = PJ_IO_UNITS_CLASSIC; \
return P; \
} \
+ \
PJ *pj_projection_specific_setup_##name (PJ *P)
+
+/* In ISO19000 lingo, an operation is either a conversion or a transformation */
+#define CONVERSION(name, need_ellps) OPERATION (name, need_ellps)
+#define TRANSFORMATION(name, need_ellps) OPERATION (name, need_ellps)
+
+/* In PROJ.4 a projection is a conversion taking angular input and giving scaled linear output */
+#define PROJECTION(name) CONVERSION (name, 1)
+
#endif /* def PJ_LIB__ */
+
+
+
int pj_generic_selftest (
char *e_args,
char *s_args,