aboutsummaryrefslogtreecommitdiff
path: root/src/4D_api.cpp
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2020-04-13 10:32:05 +0200
committerGitHub <noreply@github.com>2020-04-13 10:32:05 +0200
commit031b6ab95e4bedbf2f8f5d55407562b2b69ce98f (patch)
treebe30b23ad491e2bd2970ee9a281c0867624b5b3b /src/4D_api.cpp
parentb0215f78903a0303c8c214119dc1b1508ffef846 (diff)
parent925ae56c40b0cfa7d861f55e4332cb5603168a2c (diff)
downloadPROJ-031b6ab95e4bedbf2f8f5d55407562b2b69ce98f.tar.gz
PROJ-031b6ab95e4bedbf2f8f5d55407562b2b69ce98f.zip
Merge pull request #2144 from kbevers/proj_degree_inoutput
Add proj_degree_input() and proj_degree_output()
Diffstat (limited to 'src/4D_api.cpp')
-rw-r--r--src/4D_api.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp
index 6e494793..069093f2 100644
--- a/src/4D_api.cpp
+++ b/src/4D_api.cpp
@@ -93,6 +93,27 @@ int proj_angular_output (PJ *P, enum PJ_DIRECTION dir) {
return proj_angular_input (P, opposite_direction(dir));
}
+/*****************************************************************************/
+int proj_degree_input (PJ *P, enum PJ_DIRECTION dir) {
+/******************************************************************************
+ Returns 1 if the operator P expects degree input coordinates when
+ operating in direction dir, 0 otherwise.
+ dir: {PJ_FWD, PJ_INV}
+******************************************************************************/
+ if (PJ_FWD==dir)
+ return pj_left (P)==PJ_IO_UNITS_DEGREES;
+ return pj_right (P)==PJ_IO_UNITS_DEGREES;
+}
+
+/*****************************************************************************/
+int proj_degree_output (PJ *P, enum PJ_DIRECTION dir) {
+/******************************************************************************
+ Returns 1 if the operator P provides degree output coordinates when
+ operating in direction dir, 0 otherwise.
+ dir: {PJ_FWD, PJ_INV}
+******************************************************************************/
+ return proj_degree_input (P, opposite_direction(dir));
+}
/* Geodesic distance (in meter) + fwd and rev azimuth between two points on the ellipsoid */
PJ_COORD proj_geod (const PJ *P, PJ_COORD a, PJ_COORD b) {