Skip to content

Commit 2ca2ed0

Browse files
PaulWesselgithub-actions[bot]
authored andcommitted
if -R -J is given with -T then we must deal with them (#3675)
* if -R -J is given with -T then we must deal with them The inisital PR only called map_setup if RJ was required but in fact we must call map_setup if -R -J is given. * Update gmt_init.c
1 parent 5606bd6 commit 2ca2ed0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/gmt_init.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13675,8 +13675,10 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name,
1367513675
}
1367613676
if (options && strstr (mod_name, "mapproject") && (opt = GMT_Find_Option (API, 'W', *options))) /* Must turn on JR */
1367713677
required = "JR";
13678-
if (options && !strcmp (mod_name, "psxy") && (opt = GMT_Find_Option (API, 'T', *options)) && (opt = GMT_Find_Option (API, 'B', *options)) == NULL) /* Can turn off JR if -T and no -B */
13679-
required = "";
13678+
if (options && !strcmp (mod_name, "psxy") && (opt = GMT_Find_Option (API, 'T', *options)) && (opt = GMT_Find_Option (API, 'B', *options)) == NULL) { /* Can turn off JR if -T and no -B as long as -X -Y do not contain c */
13679+
if (!(((opt = GMT_Find_Option (API, 'X', *options)) && opt->arg[0] == 'c') || ((opt = GMT_Find_Option (API, 'Y', *options)) && opt->arg[0] == 'c')))
13680+
required = "";
13681+
}
1368013682

1368113683
if (options && strstr (mod_name, "grdflexure") && (opt = GMT_Find_Option (API, 'Q', *options))) /* Must turn of g */
1368213684
required = "";

src/psxy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) {
10601060
Return (GMT_RUNTIME_ERROR);
10611061
GMT_Report (API, GMT_MSG_DEBUG, "Operation will require %d input columns [n_cols_start = %d]\n", n_needed, n_cols_start);
10621062

1063-
if (!Ctrl->no_RJ_needed && gmt_M_err_pass (GMT, gmt_map_setup (GMT, GMT->common.R.wesn), ""))
1063+
if (GMT->common.R.active[RSET] && GMT->common.J.active && gmt_M_err_pass (GMT, gmt_map_setup (GMT, GMT->common.R.wesn), ""))
10641064
Return (GMT_PROJECTION_ERROR);
10651065
if (S.u_set) { /* When -Sc<unit> is given we temporarily reset the system unit to these units so conversions will work */
10661066
save_u = GMT->current.setting.proj_length_unit;

0 commit comments

Comments
 (0)