Skip to content

grdcontour - issue warning if no contours are drawn and finalize plot and some other minor issues #597

@anbj

Description

@anbj
  1. Giving a grdcontour [..] -L<low/high> which yields no contours should issue a warning as well as finalizing the plot (even if no contours were drawn).
~/temp 08:46:34 $ grdimage -JS0/90/10c -RNO @earth_relief_30m.grd -P -K > plot.ps
~/temp 08:46:45 $ grdcontour -J -R @earth_relief_30m.grd -O -C1000 -Bafg -L10000/100000 >> plot.ps
~/temp 08:46:48 $ psconvert -Tf -A plot.ps
psconvert [ERROR]: plot.ps: GMT PS format detected but file is not finalized. Maybe a -K in excess? plot.pdf could be messed up.
  1. Also, giving -C0 (zero contour interval) does not really makes sense, right? E.g.
$ grdcontour -JS0/90/10c -RNO @earth_relief_30m.grd -C0 -Bafg > 0_cont_int.ps

But it will plot the same as giving -C+0

$ grdcontour -JS0/90/10c -RNO @earth_relief_30m.grd -C+0 -Wthick,red -Bafg > plot_0_cont_only.ps

Maybe this is wanted, but an alternative would be to issue warning/information.

  1. Giving this command gives strange output, but seems to work fine.
$ grdcontour -JS0/90/10c -RNO @earth_relief_30m.grd -C1 -Bafg > plot.ps
grdcontour [ERROR]: Error in map_wesn_clip: odd number of crossings?grdcontour [ERROR]: Error in map_wesn_clip: odd number of crossings?grdcontour [ERROR]: Error in map_wesn_clip: odd number of crossings?grdcontour [ERROR]: Error in map_wesn_clip: odd number of crossings?

The error disappears if the contour interval (-C) is > 12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions