Skip to content
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 doc/rst/source/grdtrack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ Optional Arguments
counter-clockwise. Finally, you can use **+f** to set a fixed azimuth
for all profiles. **Note**: If |-C| is set and *spacing* is given then
that sampling scheme overrules any modifier set in |-E|.
Currently, there is a bug when |-C| and |-E| use different units
(see PR `#8728 <https://github.com/GenericMappingTools/gmt/pull/8728>`_ ).
If you use both, please manually specify the same unit for each.

.. _-D:

Expand Down
10 changes: 10 additions & 0 deletions src/grdtrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,16 @@ EXTERN_MSC int GMT_grdtrack (void *V_API, int mode, void *args) {
}
if (gmt_init_distaz (GMT, Ctrl->E.unit, Ctrl->E.mode, GMT_MAP_DIST) == GMT_NOT_A_VALID_TYPE) /* Initialize the distance unit and scaling */
Return (GMT_NOT_A_VALID_TYPE);

/* !!! TEMPORARY METHOD !!! */
/* Currently we cannot use different units in -C and -E, we have to prevent this bug first. See PR #8728 */
/* Check whether -C and -E use different unit */
if (Ctrl->C.active && Ctrl->C.unit != Ctrl->E.unit){
GMT_Report (API, GMT_MSG_ERROR,
"Option -C and -E shoule take the same unit, but received %c (-C) and %c (-E). "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please rephrase this to:
"Sorry but a current limitation obliges that options -C and -E must have the same unit, but received %c (-C) and %c (-E). "
"You must explicitly set the same unit for -C and -E.\n", Ctrl->C.unit, Ctrl->E.unit);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for delay response. Maybe you can edit it later ?

"Recommend you explicitly set the same unit for -C and -E.\n", Ctrl->C.unit, Ctrl->E.unit);
Return (GMT_RUNTIME_ERROR);
}

/* Set default spacing to half the min grid spacing: */
Ctrl->E.step = 0.5 * MIN (GC[0].G->header->inc[GMT_X], GC[0].G->header->inc[GMT_Y]);
Expand Down
Loading