FIX: check whether -C and -E use different unit in grdtrack#8728
FIX: check whether -C and -E use different unit in grdtrack#8728joa-quim merged 4 commits intoGenericMappingTools:masterfrom
grdtrack#8728Conversation
|
Ideally we should allow to give different units in -C and -E, that is, to fix the bug. But I agree that at least we must prevent the bug. The situation is even worst since using the default units in -C (meters) and not specifying them also gives a wrong result. Could you please also add information to this limitation to the documentation? |
| /* 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). " |
There was a problem hiding this comment.
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);
There was a problem hiding this comment.
Sorry for delay response. Maybe you can edit it later ?
|
No problem. I added it directly to master. |
bug description
In
grdtrackmodule,-Cand-Euse different default units for geographic grids (meter for-C, kilometer for-E). Users might comfused about the result if they did't explicitly set units.Also, it seems that
-Cand-Ecannot use different units, even if I explicity set them. For example,while the result seems fine if I set the same unit,
What's changed
Not perfect solution, I just add an
ifstatement to check whether they are the different unit. After recompiling, same command above will return error,