Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dateline crossing dcw polygons and tiles #8318

Merged
merged 4 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/gmt_dcw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test/baseline/grdimage.dvc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
outs:
- md5: 226f00f8bb56bfda27786069c3ecfa19.dir
nfiles: 35
- md5: 852cd5e3aed9292b7f864d0a18d207fc.dir
nfiles: 36
path: grdimage
hash: md5
9 changes: 9 additions & 0 deletions test/grdimage/dcw-180-crossers.sh
Original file line number Diff line number Diff line change
@@ -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