Skip to content

Commit

Permalink
Fix lack of 360 peridicity in R check (#8240)
Browse files Browse the repository at this point in the history
See this forum post for background.  It missed a check that if you exceed 360 then take out that multiple.  Now seems OK.
  • Loading branch information
PaulWessel authored Dec 27, 2023
1 parent cf2dc2e commit 714ea6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gmt_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ GMT_LOCAL int gmtmap_cyl_validate_clon (struct GMT_CTRL *GMT, unsigned int mode)
}
}
else if (!GMT->common.R.oblique) { /* For regional (<360) areas we cannot have clon > 180 away from either boundary */
double dw = fabs (GMT->current.proj.pars[0] - GMT->common.R.wesn[XLO]);
double de = fabs (GMT->current.proj.pars[0] - GMT->common.R.wesn[XHI]);
double dw = fabs (GMT->current.proj.pars[0] - GMT->common.R.wesn[XLO]); if (dw >= 360) dw -= 360.0;
double de = fabs (GMT->current.proj.pars[0] - GMT->common.R.wesn[XHI]); if (de >= 360) de -= 360.0;
if (dw > 180.0 || de > 180.0) {
if (mode == 2) { /* Yield an error if fixed central longitude, range < 360, and exceed 180 to the border from central longitude */
static char *border[2] = {"Western", "Eastern"};
Expand Down

0 comments on commit 714ea6b

Please sign in to comment.