Skip to content

Commit

Permalink
if -R -J is given with -T then we must deal with them (#3675)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
PaulWessel authored and github-actions[bot] committed Jul 18, 2020
1 parent 5606bd6 commit 2ca2ed0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -13675,8 +13675,10 @@ struct GMT_CTRL *gmt_init_module (struct GMTAPI_CTRL *API, const char *lib_name,
}
if (options && strstr (mod_name, "mapproject") && (opt = GMT_Find_Option (API, 'W', *options))) /* Must turn on JR */
required = "JR";
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 */
required = "";
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 */
if (!(((opt = GMT_Find_Option (API, 'X', *options)) && opt->arg[0] == 'c') || ((opt = GMT_Find_Option (API, 'Y', *options)) && opt->arg[0] == 'c')))
required = "";
}

if (options && strstr (mod_name, "grdflexure") && (opt = GMT_Find_Option (API, 'Q', *options))) /* Must turn of g */
required = "";
Expand Down
2 changes: 1 addition & 1 deletion src/psxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ EXTERN_MSC int GMT_psxy (void *V_API, int mode, void *args) {
Return (GMT_RUNTIME_ERROR);
GMT_Report (API, GMT_MSG_DEBUG, "Operation will require %d input columns [n_cols_start = %d]\n", n_needed, n_cols_start);

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

0 comments on commit 2ca2ed0

Please sign in to comment.