GenericMappingTools / gmt

The Generic Mapping Tools
https://www.generic-mapping-tools.org
Other
860 stars 359 forks source link

GMT6: incorrect regions when plotting using EPSG:3031 (Antarctic Polar Stereographic) #6938

Open smudog opened 2 years ago

smudog commented 2 years ago

Description of the problem I have been trying to plot - first with pygmt and then with gmt6.4 antarctic data projected in EPSG:3031 (south polar stereographic with true scale at 71 south) and lat long data, and finding that when plotting using the epgs flag, the region plotted is not aligned with the region commanded, resulting in misalignment. This appears to work fine when using the "S" original syntax. Below shows the epsg output, -Js and -JS output, and green dots showing the corner coordinates used to define the region. Note that the true scale at 71 south is not a linear scaling, but is a non-linear deformation compared to true scale at 90.

Might be related to issue #4352.

Full script that generated the error

!/bin/bash

trap 'echo $LINENO; exit' ERR 

X1=122.62152014692141
X2=109.40195764826689
Y1=-66.89884214580835
Y2=-65.03587792781053

outfile=stereo_test.ps

REGION=-R$X1/$Y1/$X2/$Y2+r

proj="epsg:3031/5c"
gmt pscoast $REGION -Ggray -Dh -J$proj -Bxag -Byag -B+t"${proj}" -K  > $outfile
echo $X1 $Y1 | gmt psxy -R -J -Sc0.25c -Ggreen -O -K -N >> $outfile
echo $X2 $Y2 | gmt psxy -R -J -Sc0.25c -Ggreen -O -K -N >> $outfile

proj="s0/-90/-71/1:10000000"
gmt pscoast $REGION  -Ggray -Dh -J${proj} -Bxag -Byag -B+t${proj} -X9c -K -O >> $outfile
echo $X1 $Y1 | gmt psxy -R -Js -Sc0.25c -Ggreen -O -K -N >> $outfile
echo $X2 $Y2 | gmt psxy -R -Js -Sc0.25c -Ggreen -O -K -N >> $outfile

proj="S0/-90/5c"
gmt pscoast -Ggray -Dh -J$proj $REGION -Bxag -Byag -B+t${proj} -X9c -K -O >> $outfile
echo $X1 $Y1 | gmt psxy -R -JS -Sc0.25c -Ggreen -O -K -N >> $outfile
echo $X2 $Y2 | gmt psxy -R -JS -Sc0.25c -Ggreen -O -N >> $outfile
gmt psconvert -A -P -Tg $outfile

Full error message

No error messages result.

Actual outcome stereo_test

System information

welcome[bot] commented 2 years ago

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. We appreciate that you took the time to contribute!

Please make sure you read our Contributing Guide and abide by our Code of Conduct.