From fa2055680c60ab1fc4d33e7101011dfe47474b0d Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Sun, 7 Jan 2024 17:33:33 +0100 Subject: [PATCH 1/2] The -R string from three coutries crossing 180 was bad The USA, Russia, and Fiji are the only country polygons that cross lon = 180. That gave us odd -Rw/e/s/n strings such as 172.436/-66.9489/18.9099/71.3907 for the US. With west > east we run into trouble when building the list of remote file tiles (e.g., the @earth_relief ******_p.jp2 that needs to be downloaded). The result was a blank map. I verified this was the same with GMT 6.4 so it is not a new bug; it has probably been there since Day 1 of remote data set implementation but nobody used -RUS, -RRU or -RFJ before. This PR simply does the sanity check that if if east < west we subtract 360 from west, since it is assumed all global files are on the -Rd layout. With this fix the plots for the three countries now works. --- src/gmt_dcw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gmt_dcw.c b/src/gmt_dcw.c index a23b25bbac7..96d9b4e5b02 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; } + if (wesn[XHI] < wesn[XLO]) { /* Cannot tolerate that west larger than east */ + wesn[XLO] -= 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); From 60c3475e06a6820a93497c8b98635218aa92afa6 Mon Sep 17 00:00:00 2001 From: Paul Wessel Date: Fri, 12 Jan 2024 09:23:00 +0100 Subject: [PATCH 2/2] Update gmt_remote.c Give more sensible warning if remote server is set or not set but cannot find file. --- src/gmt_remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gmt_remote.c b/src/gmt_remote.c index ee1f8bf17ff..e83d08b8449 100644 --- a/src/gmt_remote.c +++ b/src/gmt_remote.c @@ -1513,7 +1513,7 @@ int gmt_download_file (struct GMT_CTRL *GMT, const char *name, char *url, char * if (be_fussy || !(curl_err == CURLE_REMOTE_FILE_NOT_FOUND || curl_err == CURLE_HTTP_RETURNED_ERROR)) { /* Unexpected failure - want to bitch about it */ GMT_Report (API, GMT_MSG_ERROR, "Libcurl Error: %s\n", curl_easy_strerror (curl_err)); if (curl_err == CURLE_HTTP_RETURNED_ERROR) - GMT_Report (API, GMT_MSG_ERROR, "Probably means %s does not exist on the remote server\n", name); + GMT_Report (API, GMT_MSG_ERROR, "Probably means %s does not exist on the remote server [%s]\n", name, GMT->session.DATASERVER == NULL ? "not set" : GMT->session.DATASERVER); error = curl_err; if (urlfile.fp != NULL) { fclose (urlfile.fp);