Skip to content

New MAP_LENGTH_UNIT default #6271

Closed
Closed

Description

@maxrjones

Description of the desired feature

Originally posted by @PaulWessel in #6190 (comment), this feature request is for MAP_LENGTH_UNIT as a way to change the default unit for map distances. To summarize the discussion in that thread, the default is not currently consistent with most places having m but several places (-SE and likely map project, grdproject, and project) having km as the default.

Example usage:

echo "0 0 20" | gmt plot -SE- -Bafg10 -JH10c -Rd -W2p,green --MAP_LENGTH_UNIT=d -png test

for the same results as:

echo "0 0 20d" | gmt plot -SE- -Bafg10 -JH10c -Rd -W2p,green -png test

Activity

  1. added
    feature request
    on Jan 26, 2022
  2. self-assigned this
    on Jan 28, 2022
  3. PaulWessel commented on Jan 28, 2022

    @PaulWessel
    Contributor

    First, I think it is reasonable to say that we do not (always) control what happens in the supplements. There are places there where km is a hardwired unit, while in other places you have choices between default meter but can append k to get km. Unless we did a lot of work to generalize all these modules to accept e|f|M|n|u it makes little sense to consider MAP_LENGTH_UNIT. I dont think we want to do that, and most of those modules are specific science module where futzing around with miles and feet is silly anyway. SI is the game here.

    Another issue to solve is this: Given that GMT states the default map unit distance is meter, it seems reasonable to assume that MAP_LENGTH_UNIT would be initialized to e (meter). However, in plot project grdtrack and others we state the default unit is km. How would we handle this with MAP_LENGTH_UNIT? If we say --MAP_LENGTH_UNIT=e on the command line then we are not changing the system setting at all. We would have to detect that MAP_LENGTH_UNIT was not set and hence assume k instead, whereas if MAP_LENGTH_UNIT was actually set via gmt.conf or -- then we should honor it. It seems a bit far-fetched to declare a bug for all of this and revert to meter in -SE, for instance, so that this could all be consistent. So I think we are stuck with the modules that say km is the default. For lots of places we can specify the unit we want (e.g., mapproject -Fn) but only in a few places do we read data and worry about appending map distance units. At least one exception is gmt plot for -SE, -SJ, and -SW were the default unit is km. Many users may want to use different units without appending them to the data themselves. For plot symbol size we allow these three choices:

    1. Append the plot unit to the size in the data column, e.g. 0.5i
    2. Use --PROJ_LENGTH_UNIT to imply the unit, e.g., --PROJ_LENGTH_UNIT=inch
    3. Append the unit to the symbol, e.g., -Sci (read circle size from file in inches)

    Given the complications with introducing a map distance unit default setting, perhaps the best solution here in gmt plot and plot3d is to allow giving the unit in the same way, e.g., -SEd for ellipse with axes given in degrees? We can already give constant dimensions with units, as in -SE30/2d/100k. This would solve the present problem without introducing a hobbled MAP_LENGTH_UNIT setting that cannot be used in many units and especially the supplements.

    So my proposed solution to this issue is not to introduce MAP_LENGTH_UNIT but allow a map length unit in -S for those three symbols that accept map unit dimensions. Pinging @joa-quim as well on this to see if he has a different perspective.

  4. PaulWessel commented on Jan 28, 2022

    @PaulWessel
    Contributor

    Having slept on this, it seems we cannot introduce a new GMT defaults that would be ignored by numerous modules (pretty much all supplement codes) - that would be a first. And given the similarity with -Sci I think -SEd is the way to go. Objections, anyone?

  5. maxrjones commented on Mar 18, 2022

    @maxrjones
    MemberAuthor

    Closed by alternative solution implemented in #6282.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions