Bug #954

Strange latitude axis - Stereographic Equal-Angle projection (-JS)

Added by Andreas 8 months ago. Updated 16 days ago.

Status:ResolvedStart date:2016-08-15
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.2.x Platform:


I'm getting a strange latitude axis in some cases when plotting with -JS.

In bad.bat I'm giving the grid to the -R-argument giving a strange latitude axis.

In good.bat I'm giving the region explicitly (-R-180/180/64/90) which gives good latitude axis.

In dummy.bat I'm creating a grid with just a constant value. Then, giving the grid to the -R-argument works just fine.

Happens with all MAP_FRAME_TYPEs

I'm using Version 5.2.1 (r15220)

bad.bat (709 Bytes) Andreas, 2016-08-15 22:58

bad.png (641 KB) Andreas, 2016-08-15 22:58

good.bat (705 Bytes) Andreas, 2016-08-15 23:00

good.png (658 KB) Andreas, 2016-08-15 23:00

dummy.bat (789 Bytes) Andreas, 2016-08-15 23:00

dummy.png (404 KB) Andreas, 2016-08-15 23:00

IBCAO_6m.nc (2.58 MB) Andreas, 2016-08-15 23:01

bad_new_20161101.png (606 KB) Andreas, 2016-11-01 03:13

bad_09042017.png (602 KB) Andreas, 2017-04-09 06:24

Associated revisions

Revision 17305
Added by Paul 6 months ago

Address remaining latitude problem of issue #954

Revision 17899
Added by Paul 16 days ago

Address issue #954


#1 Updated by Paul 7 months ago

  • Status changed from New to In Progress
  • Assignee set to Paul

So this happens because there is a check for global grids, i.e., that west-east ~ 360. However, your grid is a bit sloppy:
x:actual_range = -180.000000000033, 179.999999999966 ;
so e-w = 359.999999999998977
and that fails our quite strict test for 360. We will see where we can add in the relaxation. The noise probably comes from Arc doing math in float or something.

#2 Updated by Paul 7 months ago

  • Status changed from In Progress to Resolved
  • Target version set to Candidate for next bugfix release
  • % Done changed from 0 to 100

I relaxed the test in the gmt_M_360_range macro and now your example passes (please try). In r17155.

#3 Updated by Andreas 7 months ago

Great Pål, thanks. Will test as soon as 5.3 is released.

#4 Updated by Paul 6 months ago

  • Affected version changed from 5.2-svn to 5.2.x

Hi Andreas, I'd like to close this one if things work now?

#5 Updated by Andreas 6 months ago

Hi Paul,

It certainly looks a lot better now. Attached figure is what I get when I run bad.bat with GMT 5.3.1.

#6 Updated by Paul 6 months ago

Darn, there was also sloppiness in your latitude range, i.e., north was 89.9999999999667 not 90. Try r17306.

#7 Updated by Paul 6 months ago

Andreas, could you recheck this and let me know if all is fixed so I can close it?

#8 Updated by Andreas 6 months ago

Hi Paul - I would, but unfortunately I am not able (competent) to compile from latest source!

#9 Updated by Joaquim 6 months ago

... but unfortunately I am not able (competent) to compile from latest source!

Please dare and tell us what is blocking you.

#10 Updated by Andreas 6 months ago

It's simply too time consuming; I've tried before, and after reading your comment - I just tried again just now without luck. I have too little experience with this kind of stuff (I was able to compile GMT 4.5.n due to the great parameter generator and the install script - super simple). I followed the instructions (http://gmt.soest.hawaii.edu/projects/gmt/wiki/BuildingGMT), but I cant even get past the build dependencies section - the system cannot find nmake (which should be included in the SDK?!). I would love to be able to build it myself! So any tips is greatly appreciated.

#11 Updated by Joaquim 6 months ago

Ah right, you are on Windows. So you are the perfect Guinea Pig for me

Download all the dependencies from here and edit (minor edition) the ConfigUser.cmake included


Regarding the nmake issue, not sure. I use a full VS installation and than only have to open a command shell where the needed VS variables are pre-set.
Well what I really do is to call the batch that sets those env vars. Like:

call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" amd64

or (for VS2015)

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

#12 Updated by Andreas 5 months ago

I'll be sure to try this when I have the time. Thanks Joaquim. I would love to be able to do this. * squeak *

#13 Updated by Paul 17 days ago

Hi Andreas-

How does this look for you under Windows now?

#14 Updated by Andreas 16 days ago

Sure looks a lot better now, Paul. The annotations plotted at the pole in the upper middle figure is a bit awkward, but this is maybe more related to a non-optimal -B, than the issue itself.

bad_09042017.png made from running bad.bat with 5.3.3.

#15 Updated by Paul 16 days ago

We have code that turns off annotation on sides that don't exist (like the north boundary in this case) but that test happened after the annotations were completed ... Now the order if correct and those annotations are gone. In r17899.

#16 Updated by Andreas 16 days ago

Sounds great, Paul.

Also available in: Atom PDF