Skip to content

Commit e08b7bd

Browse files
committed
1 parent a199edb commit e08b7bd

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/projections/omerc.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ static PJ_LP e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inverse */
9797
u = xy.y * Q->cosrot + xy.x * Q->sinrot + Q->u_0;
9898
}
9999
Qp = exp(- Q->BrA * v);
100+
if( Qp == 0 ) {
101+
proj_errno_set(P, PJD_ERR_INVALID_X_OR_Y);
102+
return proj_coord_error().lp;
103+
}
100104
Sp = .5 * (Qp - 1. / Qp);
101105
Tp = .5 * (Qp + 1. / Qp);
102106
Vp = sin(Q->BrA * u);

test/gie/builtins.gie

+7
Original file line numberDiff line numberDiff line change
@@ -3801,6 +3801,13 @@ expect 0.000898315 -0.001808739
38013801
accept -200 -100
38023802
expect -0.000898315 -0.001808739
38033803

3804+
-------------------------------------------------------------------------------
3805+
operation +proj=omerc +R=1 +lat_0=1 +lat_1=2 +no_rot
3806+
-------------------------------------------------------------------------------
3807+
direction inverse
3808+
accept 0 1e200
3809+
expect failure errno invalid_x_or_y
3810+
38043811

38053812
===============================================================================
38063813
Ortelius Oval

0 commit comments

Comments
 (0)