Skip to content

Attempt to fix coast holes in Canada for some -A settings - #7121

Merged
PaulWessel merged 1 commit into
masterfrom
coast-holes
Nov 28, 2022
Merged

PaulWessel merged 1 commit into
masterfrom
coast-holes

Conversation

@PaulWessel

Copy link
Copy Markdown
Contributor

See #7109 for background. We did have checks for this but it seemed only tailored to the Antarctica case and the code refers to #1295 which we tried to fix. This PR restricts that Antarctica check to Antarctica only (< 60S) and applies the general fix elsewhere, which is to reduce the node level of the corner if a polygon covering it is skipped. This seems to fix the problem and older tests still work.

See #7109 for background.  We did have checks for this but it seemed only tailored to the Antarctica case and the code refers to #1295 which we tried to fix.  This PR restricts that Antarctica check to Antarctica only (< 60S) and applies the general fix elsewhere, which is to reduce the node level of the corner if a polygon covering it is skipped.  This seems to fix the problem and older tests still work.
@PaulWessel PaulWessel added the bug Something isn't working label Nov 27, 2022
@PaulWessel PaulWessel added this to the 6.5.0 milestone Nov 27, 2022
@PaulWessel PaulWessel self-assigned this Nov 27, 2022

@KristofKoch KristofKoch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected for me now in 6.5.0_578b7c8_2022.11.27 Thank you Paul!

@KristofKoch

Copy link
Copy Markdown
Contributor

To be really sure that Paul's fix works I had a closer look at Earth from all sides. I used -Di -A0 – -Di -A20500 with a step sizes of 500. I didn't find any "missing" tiles on the 264 plots. But have a look for yourself:

globes_0_10500

Some code that produces two jpeg files about 25MB each:

while read minA maxA stepsize rows columns
do
  gmt begin globes_${minA}_${maxA} jpg
    gmt subplot begin ${rows}x${columns} -Fs8c -M1c/3c \
      -T"Tiling test -A${minA} ... -A${maxA}\r"
      for ((a = ${minA}; a <= ${maxA}; a=a+${stepsize}))
      do
        for ((lat = -45; lat <= 45; lat = lat+90))
        do
          for ((lon = -120; lon <= 120; lon = lon+120))
          do
            gmt subplot set
            gmt coast -JG${lon}/${lat}/8c -Rg -Bg -Di -A${a} \
              -Gblack -Sgrey95 -B+t"-A${a}"+s"Lat ${lat} / Lon ${lon}"
          done
        done
      done
    gmt subplot end
  gmt end show
done << EOF
    0 10500 500 11 12
11000 20500 500 11 12
EOF

@PaulWessel

Copy link
Copy Markdown
Contributor Author

Nice test, @KristofKoch ! A bit too big to add to our suite though. Looks like this is fixed for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants