From 11c33ae1f6c210e01caffd7712edec646ab90c31 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 20 Oct 2026 15:58:24 -0300 Subject: [PATCH 1/4] Remove the known-failure flag from psxy/nojump Co-Authored-By: Claude Opus 5.5 --- test/psxy/nojump.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/test/psxy/nojump.sh b/test/psxy/nojump.sh index 7c3e43adb3f..0501c7a4427 100755 --- a/test/psxy/nojump.sh +++ b/test/psxy/nojump.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash -# GMT_KNOWN_FAILURE # Added after issue #672 which exposed a map jump that should not happen # Fixed in r14052 but we keep this test in case it resurfaces # Well, bottom panel plots the wrong closed polygon From dc8a22293c915b55dda01ea9cacaf52a9bd439eb Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 20 Oct 2026 15:58:24 -0300 Subject: [PATCH 2/4] Restore the 180-degree jump test in gmtmap_jump_x Commit 0370cd83d6 (2018) compared the longitude separation of two consecutive points against half the -R width instead of 180 degrees, so in regions 90-360 degrees wide any segment longer than half the region was treated as a map jump and drawn the other way (test psxy/nojump, bottom panel). For 360-degree regions the threshold was already 180. Co-Authored-By: Claude Opus 5.5 --- src/gmt_map.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gmt_map.c b/src/gmt_map.c index 8d0b6f5baad..40616a04f63 100644 --- a/src/gmt_map.c +++ b/src/gmt_map.c @@ -1148,7 +1148,7 @@ GMT_LOCAL unsigned int gmtmap_genper_crossing (struct GMT_CTRL *GMT, double lon1 GMT_LOCAL int gmtmap_jump_x (struct GMT_CTRL *GMT, double x0, double y0, double x1, double y1) { /* true if x-distance between points exceeds 1/2 map width at this y value */ - double dx, map_half_size, half_lon_range; + double dx, map_half_size; if (!(gmt_M_is_cylindrical (GMT) || gmt_M_is_perspective (GMT) || gmt_M_is_misc (GMT))) return (0); /* Only projections with periodic boundaries may apply */ @@ -1157,7 +1157,6 @@ GMT_LOCAL int gmtmap_jump_x (struct GMT_CTRL *GMT, double x0, double y0, double map_half_size = MAX (gmt_half_map_width (GMT, y0), gmt_half_map_width (GMT, y1)); if (fabs (map_half_size) < GMT_CONV4_LIMIT) return (0); - half_lon_range = (GMT->common.R.oblique) ? 180.0 : 0.5 * (GMT->common.R.wesn[XHI] - GMT->common.R.wesn[XLO]); dx = x1 - x0; if (fabs (dx) > map_half_size) { /* Possible jump; let's see how far apart those longitudes really are */ /* This test on longitudes was added to deal with issue #672, also see test/psxy/nojump.sh */ @@ -1165,7 +1164,7 @@ GMT_LOCAL int gmtmap_jump_x (struct GMT_CTRL *GMT, double x0, double y0, double gmt_xy_to_geo (GMT, &last_lon, &dummy, x0, y0); gmt_xy_to_geo (GMT, &this_lon, &dummy, x1, y1); gmt_M_set_delta_lon (last_lon, this_lon, dlon); /* Beware of jumps due to sign differences */ - if (fabs (dlon) < half_lon_range) /* Not going the long way so we judge this to be no jump */ + if (fabs (dlon) < 180.0) /* Not going the long way so we judge this to be no jump */ return (0); /* Jump it is */ if (dx > map_half_size) return (-1); /* Cross left/west boundary */ From be217a203a5bb23ca6e6502036a6e80a054e8e84 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 20 Oct 2026 18:43:17 -0300 Subject: [PATCH 3/4] Regenerate the psxy/nojump baseline The 2015 baseline has the old degree symbol and hyphen-minus in the axis annotations (changed in 586758f64b, 2018-12-06), so it fails on every platform even though the lines are now drawn correctly. Co-Authored-By: Claude Opus 5.5 --- test/baseline/psxy.dvc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/baseline/psxy.dvc b/test/baseline/psxy.dvc index a2018e0e636..b1c26a3594e 100644 --- a/test/baseline/psxy.dvc +++ b/test/baseline/psxy.dvc @@ -1,5 +1,6 @@ outs: -- md5: fd04135cb8226c86f8f109e5dca463fe.dir +- md5: 6dbbc75aa2f8752b1450e4f22b7656f2.dir nfiles: 147 path: psxy hash: md5 + size: 9555170 From df71eea613e402d589e68b1668594231e3c87567 Mon Sep 17 00:00:00 2001 From: Esteban82 Date: Tue, 20 Oct 2026 23:49:56 -0300 Subject: [PATCH 4/4] gmtmap_jump_x: Keep the regional jump test, skip it when the straight path is the short way Returning to 180 degrees alone (previous commit) loses the jump detection for regional maps: an -A line from -110 to 110 in -R-120/120 must go the short way through the gap outside the region, and a filled polygon in -R0/200 must not become self-crossing. Restore the half-width test and only add: if the longitudes taken relative to the central meridian are less than 180 degrees apart, the straight path is the short way and there is no jump. This can only remove jumps the old code reported. Co-Authored-By: Claude Sonnet 5.5 --- src/gmt_map.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/gmt_map.c b/src/gmt_map.c index 40616a04f63..4392c280e90 100644 --- a/src/gmt_map.c +++ b/src/gmt_map.c @@ -1148,7 +1148,7 @@ GMT_LOCAL unsigned int gmtmap_genper_crossing (struct GMT_CTRL *GMT, double lon1 GMT_LOCAL int gmtmap_jump_x (struct GMT_CTRL *GMT, double x0, double y0, double x1, double y1) { /* true if x-distance between points exceeds 1/2 map width at this y value */ - double dx, map_half_size; + double dx, map_half_size, half_lon_range; if (!(gmt_M_is_cylindrical (GMT) || gmt_M_is_perspective (GMT) || gmt_M_is_misc (GMT))) return (0); /* Only projections with periodic boundaries may apply */ @@ -1157,14 +1157,19 @@ GMT_LOCAL int gmtmap_jump_x (struct GMT_CTRL *GMT, double x0, double y0, double map_half_size = MAX (gmt_half_map_width (GMT, y0), gmt_half_map_width (GMT, y1)); if (fabs (map_half_size) < GMT_CONV4_LIMIT) return (0); + half_lon_range = (GMT->common.R.oblique) ? 180.0 : 0.5 * (GMT->common.R.wesn[XHI] - GMT->common.R.wesn[XLO]); dx = x1 - x0; if (fabs (dx) > map_half_size) { /* Possible jump; let's see how far apart those longitudes really are */ /* This test on longitudes was added to deal with issue #672, also see test/psxy/nojump.sh */ - double last_lon = 0.0, this_lon = 0.0, dummy = 0.0, dlon; + double last_lon = 0.0, this_lon = 0.0, dummy = 0.0, dlon, d0, d1; gmt_xy_to_geo (GMT, &last_lon, &dummy, x0, y0); gmt_xy_to_geo (GMT, &this_lon, &dummy, x1, y1); gmt_M_set_delta_lon (last_lon, this_lon, dlon); /* Beware of jumps due to sign differences */ - if (fabs (dlon) < 180.0) /* Not going the long way so we judge this to be no jump */ + if (fabs (dlon) < half_lon_range) /* Not going the long way so we judge this to be no jump */ + return (0); + gmt_M_set_delta_lon (GMT->current.proj.central_meridian, last_lon, d0); /* Longitudes relative to the central meridian */ + gmt_M_set_delta_lon (GMT->current.proj.central_meridian, this_lon, d1); + if (fabs (d1 - d0) < 180.0) /* The straight path is the short way, so no jump */ return (0); /* Jump it is */ if (dx > map_half_size) return (-1); /* Cross left/west boundary */