Skip to content

Clipping fails for grdview #8036

Closed

Description

@PaulWessel

Reduced the case reported on the forum reduced to this simple example:

gmt begin 3dbug png
	gmt grdview  @earth_relief_10m -JB-90/21/19/23/10c -R-92/-87/19/23 -p-30/90 -Cglobe -B -BWSen -Qi50
	gmt grdimage @earth_relief_10m -p -Cglobe -B -BWSen -X12c
gmt end show

Same plot but with two different modules. The left plot uses grdview which has a bug while grdimage does not.

3dbug

Both -Qi and -Qc give the same problem, but doing tiles (-Qs) is unaffected. Suspicion is that the computed mask polygon in grdview is not properly 3-D projected, while grdimage does not have such a thing.

Activity

  1. added
    bug
    on Nov 13, 2023
  2. self-assigned this
    on Nov 13, 2023
  3. joa-quim commented on Nov 20, 2023

    @joa-quim
    Member

    I think this was fixed, right?

  4. PaulWessel commented on Nov 20, 2023

    @PaulWessel
    ContributorAuthor

    No, and on the road.

  5. PaulWessel commented on Nov 24, 2023

    @PaulWessel
    ContributorAuthor

    Strange things going on. I ran the grdview twice: One with -Qc (image on left) and another with -Qs (surface polygons on right). This yields correct for -Qs and a bad clip(?) for -Qc:

    3dbug

    However, if I edit the two PostScript files and remove all the stuff that plots the color surface or color image, we are left with basic setup, clip paths, and basemap. The diff of those edited files show no differences. So same clip path, which works fine for surfaces but not for tiling or images. Conclusion must be that the images and the tiling are not doing the right thing, even though they happen in separate branches in grdview code. Using polygon tiles (-T) shows the same bad clipping in grdview (but not in grdimage as the top plot shows).

    Clearly, the pixels that do show (on the left image) are in the right place (comparing to surface on right) so it would seem the loop over pixels or tiles is skipping those locations since the clip is the same? Adding a vertical scale (-JZ3c) correctly strengths this in the z-dimensions but the clipping is the same. Any thoughts on how to figure this out is appreciated.

  6. PaulWessel commented on Nov 24, 2023

    @PaulWessel
    ContributorAuthor

    Oops, grdview tiling (-T) also places this in the wrong place:

    t

    Looks rotated and shifted.

  7. added a commit that references this issue on May 14, 2026
    a197f38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions