Closed
Description
- 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.
- 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.
- 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
Labels
No labels
Activity
Strengthen contouring checks
Strengthen contouring checks (#598)
anbj commentedon Apr 4, 2019
I expected to get the new info
giving this command
but it didnt.
PaulWessel commentedon Apr 4, 2019
You need to use -V to get any warnings, otherwise you will only see error messages, and that case is not an error (maybe user error, but that is not what error means here). Let me know if -V does it for you - that was the intention.
anbj commentedon Apr 4, 2019
I see, now I get
and I see that there may be a warning for this already? https://github.com/GenericMappingTools/gmt/blob/master/src/grdcontour.c#L1221
PaulWessel commentedon Apr 4, 2019
I just now placed that second check inside the correct block so it can catch other cases where for whatever reasons no contours are drawn.
anbj commentedon Apr 5, 2019
Still getting
When should this message appear? Vs. when should
No contours drawn, check your -A, -C, -L settings?appear?PaulWessel commentedon Apr 5, 2019
Probably very rarely, such as when a contour is skipped due to -Q or when it projects to be outside the plot domain for oblique maps. The message you see catches things when the data range is outside the -L setting. But when that is not true there are still some reasons why a contour that is found somehow ends up not being drawn.
PaulWessel commentedon May 2, 2019
I think we are OK to close this one now?
anbj commentedon May 3, 2019
Yes, closing.