Skip to content

van der Grinten projection (-JV) fails in non -Rg domains #7282

Closed

Description

@KristofKoch

Description of the problem

When plotting a global map with the van der Grinten projection (-JV) everything behaves as expected, when using it to plot quadrants or hemispheres things go wild: Instead of quadrants or hemispheres I get modern art.

Full script that generated the error

gmt begin van_der_Grinten_quadrants_hemispheres png
  gmt subplot begin 2x4 -Fs8c/16c -M8c/1c -T"van der Grinten quadrant & hemisphere maps"
    while read minX maxX minY maxY title
    do
    gmt subplot set
      gmt coast -R${minX}/${maxX}/${minY}/${maxY} -JV0/8c -Bg -Dc -Glightgray -Scornsilk -A10000 -Wthinnest -B+t"${title}"
    done << EOF
-180   0   0 90 NW
   0 180   0 90 NE
   0 180 -90  0 SE
-180   0 -90  0 SW
-180   0 -90 90 W
-180 180   0 90 N
   0 180 -90 90 E
-180 180 -90  0 S
EOF
  gmt subplot end
gmt end show

If you prefer a one-liner use the following for a plot of the NW quadrant:

gmt coast -R-180/0/0/90 -JV0/10c -Bg -Dc -Glightgray -Scornsilk -A10000 -Wthinnest -view van_der_Grinten_NW_quadrant

Full error message

No error messages generated

Actual outcome

van_der_Grinten_quadrants_hemispheres

Expected outcome

Four quadrant maps in the first row and four hemisphere maps in the second row in above plot.

System information

  • Operating system: MacOS 13.2.1
  • GMT version (gmt --version): 6.5.0_51b8cba_2023.02.25 also fails with 6.4.0

Activity

  1. added
    bug
    on Feb 28, 2023
  2. KristofKoch commented on Feb 28, 2023

    @KristofKoch
    ContributorAuthor

    Additionally similar things happen with the Winkel Tripel projection (-JR). Maybe related?

    Trying to plot a western hemisphere:

    Central meridian is on the domain border (0°): fail
    winkel-0

    gmt coast -R-180/0/-90/90 -JR0/12c -Bg -Dc -A10000 -Gburlywood4 -Swheat1 -png winkel-0
    

    Central meridian is outside the plot domain (+0.0000001°): fail
    winkel-pos0 000001

    gmt coast -R-180/0/-90/90 -JR0.0000001/12c -Bg -Dc -A10000 -Gburlywood4 -Swheat1 -png winkel-pos0.000001
    

    Central meridian is inside the plot domain (-0.0000001°): correct
    winkel-neg0 000001

    gmt coast -R-180/0/-90/90 -JR-0.0000001/12c -Bg -Dc -A10000 -Gburlywood4 -Swheat1 -png winkel-neg0.000001
    
  3. KristofKoch commented on Feb 28, 2023

    @KristofKoch
    ContributorAuthor

    Further experimentation confirms that it fails for all projections from the Cookbook 6.4. Miscellaneous projections chapter and also for the Mercator -JM projection.

  4. PaulWessel commented on Mar 2, 2023

    @PaulWessel
    Contributor

    The pending #7287 appears to fix cases NE, SE, N, E, and S but works is needed for NW, SW and W - all probably related to central meridian issues.

  5. PaulWessel commented on Mar 2, 2023

    @PaulWessel
    Contributor

    Removing the forced 0 central longitude from the above script gives correct results. So it is an issue of what that parameters is used for and why it bites so hard.

  6. KristofKoch commented on Mar 22, 2023

    @KristofKoch
    ContributorAuthor

    Nice work! Thank you!

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