aboutsummaryrefslogtreecommitdiff
path: root/src/projections
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-12-15 01:12:34 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-12-15 14:59:52 +0100
commit2abc0aaf3a03493aaa3f940e1d420d8d9a7b804f (patch)
treea97ee512c19bcb1c854b196be9c0ced00f1c95ac /src/projections
parent54b861e14051a337d473c95389ff7f34c6ee83a8 (diff)
downloadPROJ-2abc0aaf3a03493aaa3f940e1d420d8d9a7b804f.tar.gz
PROJ-2abc0aaf3a03493aaa3f940e1d420d8d9a7b804f.zip
tmerc exact: set errno to PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN when it returns invalid coordinate
Diffstat (limited to 'src/projections')
-rw-r--r--src/projections/tmerc.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/projections/tmerc.cpp b/src/projections/tmerc.cpp
index 3093e745..7b98ea02 100644
--- a/src/projections/tmerc.cpp
+++ b/src/projections/tmerc.cpp
@@ -402,8 +402,10 @@ static PJ_XY exact_e_fwd (PJ_LP lp, PJ *P) {
if (fabs (Ce) <= 2.623395162778) {
xy.y = Q->Qn * Cn + Q->Zb; /* Northing */
xy.x = Q->Qn * Ce; /* Easting */
- } else
+ } else {
+ proj_errno_set(P, PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN);
xy.x = xy.y = HUGE_VAL;
+ }
return xy;
}
@@ -476,8 +478,10 @@ static PJ_LP exact_e_inv (PJ_XY xy, PJ *P) {
lp.phi = gatg (Q->cgb, PROJ_ETMERC_ORDER, Cn, cos_2_Cn, sin_2_Cn);
lp.lam = Ce;
}
- else
+ else {
+ proj_errno_set(P, PROJ_ERR_COORD_TRANSFM_OUTSIDE_PROJECTION_DOMAIN);
lp.phi = lp.lam = HUGE_VAL;
+ }
return lp;
}