diff --git a/src/gmt_dcw.c b/src/gmt_dcw.c index a23b25bbac7..9faaa41af88 100644 --- a/src/gmt_dcw.c +++ b/src/gmt_dcw.c @@ -900,6 +900,9 @@ struct GMT_DATASET * gmt_DCW_operation (struct GMT_CTRL *GMT, struct GMT_DCW_SEL wesn[XLO] = 0.0; wesn[XHI] = 360.0; } + /* US DCW can return dumb things like this: -R172.436/-66.9489 */ + if (wesn[XLO] > 0.0 && wesn[XHI] < 0.0) /* Crazy US, RU, and Fiji crossing dateline and get backwards limit signs... */ + wesn[XHI] += 360.0; GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Region implied by DCW polygons is %g/%g/%g/%g\n", wesn[XLO], wesn[XHI], wesn[YLO], wesn[YHI]); } gmt_M_free (GMT, order); diff --git a/test/baseline/grdimage.dvc b/test/baseline/grdimage.dvc index b39b655b54c..d381cc2f9b8 100644 --- a/test/baseline/grdimage.dvc +++ b/test/baseline/grdimage.dvc @@ -1,5 +1,5 @@ outs: -- md5: 226f00f8bb56bfda27786069c3ecfa19.dir - nfiles: 35 +- md5: 852cd5e3aed9292b7f864d0a18d207fc.dir + nfiles: 36 path: grdimage hash: md5 diff --git a/test/grdimage/dcw-180-crossers.sh b/test/grdimage/dcw-180-crossers.sh new file mode 100755 index 00000000000..49143b533be --- /dev/null +++ b/test/grdimage/dcw-180-crossers.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +# Ensure that the region for the US, Russia and Fiji are sensible +# when accessing tiles, i.e., 5m and higher resolutions. +# and that maps are made. Issue only affects tiles. +gmt begin dcw-180-crossers ps + gmt grdimage @earth_relief_05m -Bafg180 -RUS + gmt grdimage @earth_relief_05m -Bafg180 -RRU -Y7.5c + gmt grdimage @earth_relief_05m -Bafg180 -RFJ -Y4.5c +gmt end show