Skip to content

gmt basemap -R... -J... -A fails as a modern-mode one-liner #8962

Closed

Description

@mkononets

gmt basemap -R... -J... -A works in a multi-call modern mode session, works as a classic mode call but fails as a modern mode one-liner with weird error messages, see below. Tried with gmt version 6.6.0.

from the docs:

-A[file]

    No plotting is performed. Instead, we determine the geographical coordinates of 
the polygon outline for the (possibly oblique) rectangular map domain. The plot domain 
must be given via [-R](https://docs.generic-mapping-tools.org/dev/basemap.html#r) and
 [-J](https://docs.generic-mapping-tools.org/dev/basemap.html#j), with no other options 
allowed. The sampling interval is controlled via [MAP_LINE_STEP](https://docs.generic-mapping-tools.org/dev/gmt.conf.html#term-MAP_LINE_STEP) 
parameter. The coordinates are written to file or to standard output if no file is specified.

gmt basemap -JS0/-90/20c -R3000+uk -Aout.txt fails with the following error message with and without out.txt requested after -A:

gmt [ERROR]: Shared GMT module not found: basemap

ERROR: No module named basemap was found.  This could mean one of four cases:
  1. There actually is no such module; please check your spelling.
  2. You used a modern mode module name while running in GMT classic mode.
  3. Module exists in the GMT supplemental library, but the library could not be found.
  4. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.

gmt basemap -JS0/-90/20c -R3000+uk -Aout.txt -png quick also fails:

psbasemap [ERROR]: Option -p (ng): Syntax is -p[x|y|z]<azim>[/<elev>[/<zlevel>]][+w<lon0>/<lat0>[/<z0>]][+v<x0>/<y0>]
psbasemap [ERROR]: Option -p parsing failure. Correct syntax:

  -p[x|y|z]<azim>[/<elev>[/<zlevel>]][+w<lon0>/<lat0>[/<z0>]][+v<x0>/<y0>]
     Select a 3-D pseudo perspective view. Append the <azimuth>/<elevation> of
     the viewpoint [180/90], and when used with -Jz|Z, optionally add /<zlevel>
     for basemap level [bottom of z-axis]. Prepend x or y to plot against the
     "wall" x = level or y = level [z]. For a plain rotation about the z-
     axis, give rotation angle only and optionally use modifiers +w or +v to
     select location of axis:
       +w Specify a fixed coordinate point [region center].
       +v Set a fixed projected point [panel center].
psbasemap [ERROR]: Offending option -png

gmt basemap -JS0/-90/20c -R3000+uk -Aout.txt -png quick -B terminates w/o errors but produces neither the -A output nor the plot.

A classic mode call gmt psbasemap -JS0/-90/20c -R3000+uk -A produces the desired output.

Activity

  1. added
    bug
    on Apr 4, 2026
  2. Esteban82 commented on Apr 6, 2026

    @Esteban82
    Member

    I tested this and can confirm that it fails, but I’m not sure this should be considered a bug.

    The one-liner syntax is meant for commands that produce a figure, while basemap -A explicitly performs no plotting. Also, a valid one-liner requires the -format prefix option, which is missing here—and would not make sense to add in this case.

    So this seems consistent with the documented behavior rather than a bug.

  3. joa-quim commented on Apr 6, 2026

    @joa-quim
    Member

    Agree, and for that reason I guess we could find more cases involving other modules showing the same behavior.

  4. mkononets commented on Apr 6, 2026

    @mkononets
    Author

    this seems consistent with the documented behavior

    In case my long and detailed report was not really clear:

    The documented behavior is literally this:

    -A[file]
    
        No plotting is performed. Instead, we determine the geographical coordinates of 
    the polygon outline for the (possibly oblique) rectangular map domain. The plot domain 
    must be given via -R and -J, with no other options allowed... The coordinates are written 
    to file or to standard output if no file is specified.
    

    When I call gmt basemap -JS0/-90/20c -R3000+uk -Aout.txt outside session the output file promised by the docs is not created. Instead the following error message is displayed:

    gmt [ERROR]: Shared GMT module not found: basemap
    
    ERROR: No module named basemap was found.  This could mean one of four cases:
      1. There actually is no such module; please check your spelling.
      2. You used a modern mode module name while running in GMT classic mode.
      3. Module exists in the GMT supplemental library, but the library could not be found.
      4. Module exists in a GMT custom library, but none was specified via GMT_CUSTOM_LIBS.
    Shared libraries must be in standard system paths or set via environmental parameter LD_LIBRARY_PATH.
    

    The expected result is not the above message, but the out.txt file with the coordinates.

    I guess we could find more cases involving other modules showing the same behavior.

    Not sure how to interpret this. Is it supposed to be like that?

  5. joa-quim commented on Apr 6, 2026

    @joa-quim
    Member

    The modern mode is the result of a group epiphany while looking at the beautiful La Jolla Bay from a room in Scripts. The intent was to relieve newbies from learning the -K -O dance. Latter, dropping the need for at least -R, -J, -B was added too. And even latter, mostly from pressure from me, Paul added the one-liners. But all of this add in mind figure producing commands, not the data processing ones. What you found is a side effect of a plot creating command, which has a little back-door that creates data. Is it a bug because it prints ERROR: No module named basemap was found.? Maybe, but using data processing commands with modern mode was never the idea behind it.

  6. mkononets commented on Apr 6, 2026

    @mkononets
    Author

    Oh yes I remember being that newbie learning gmt version 4: one -K -O typo somewhere in the middle of a long plotting script and the resulting .ps could not have been viewed.
    That -K -O thing is definitely not good for people manually writing scripts and reusing old pieces of code by copy-pasting.

  7. added a commit that references this issue on Apr 15, 2026
    7d9cf67
  8. added a commit that references this issue on Apr 16, 2026
    c069488
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions