aboutsummaryrefslogtreecommitdiff
path: root/src/projections/adams.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-05-16 17:41:12 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-05-16 17:49:26 +0200
commitce38ade494db73ab27dbdbdab84332e4530c8d8a (patch)
tree8f75422d2fc98f5fa7b7b17493879b3ca4cb50e1 /src/projections/adams.cpp
parent2d6b5c0a9a1e0f0f92e69c641a16377ef36f8270 (diff)
downloadPROJ-ce38ade494db73ab27dbdbdab84332e4530c8d8a.tar.gz
PROJ-ce38ade494db73ab27dbdbdab84332e4530c8d8a.zip
peirce_q: limit input to positive latitudes
Otherwise it returns junk (negative latitudes are mapped to the same location as positive latitudes) I'm a bit confused by PROJ peirce_q implementation. Looking at the projection of the world, it looks like this matches the diamond formulation of the right map shown at https://desktop.arcgis.com/en/arcmap/latest/map/projections/peirce-quincuncial.htm, but limited to the inner square of this diamond (which corresponds to the northern hemisphere). We lack the 4 triangles on left, top, right and bottom for the southern hemisphere. Furthermore, this formulation of peirce_q does not seem to have the quincuncial property of the square formulation (left images of the above ESRI doc), or the one at https://en.wikipedia.org/wiki/Peirce_quincuncial_projection ...
Diffstat (limited to 'src/projections/adams.cpp')
-rw-r--r--src/projections/adams.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/projections/adams.cpp b/src/projections/adams.cpp
index 88fce8e5..e704c687 100644
--- a/src/projections/adams.cpp
+++ b/src/projections/adams.cpp
@@ -118,6 +118,10 @@ static PJ_XY adams_forward(PJ_LP lp, PJ *P) {
}
break;
case PEIRCE_Q: {
+ if( lp.phi < -TOL ) {
+ proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
+ return proj_coord_error().xy;
+ }
const double sl = sin(lp.lam);
const double cl = cos(lp.lam);
const double cp = cos(lp.phi);