Bug #949

Problem filling polygons - banding across the map

Added by Kara about 5 years ago. Updated over 4 years ago.

Status:ClosedStart date:2016-08-07
Priority:NormalDue date:
Assignee:Paul% Done:


Target version:Candidate for next bugfix release
Affected version:5.x-svn Platform:



I'm having problems using psxy to fill polygons that encompass the poles. No problems drawing the outlines, just filling using -G. I've also tried using gmtspatial to clip at the map boundary first, this helps a bit.

I'm using Version 5.3.0_r16840 [64-bit].

Attached is a sample script, two different .gmt files (exported from GPlates) that both cause problems, and two maps to show the difference between using gmtspatial and just using psxy. Hope these help.

A fix was made last year, which did help, but I guess not in all cases.


poly_test.zip (775 KB) Kara, 2016-08-08 00:06

20161212_testing_polar_polygons.zip (1.48 MB) Kara, 2016-12-12 07:28


#1 Updated by Paul about 5 years ago

  • Status changed from New to In Progress
  • Assignee set to Paul
  • Target version set to Candidate for next bugfix release

Thanks, I found polygons 31, 49, and 78 caused the wrapping and wrote a test script (test/psxy/badpols.sh) showing these failures. It has been added to our test suite (it currently fails, of course) and we will work on fixing this problem. This is a bit different that what I fixed earlier in that the map region is not global but regional, and somehow this now fails.

#2 Updated by Paul almost 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

My latest attempt seems to have fixed at least there. Could you please check again and even other cases to see if there are still issues? In r17369.

#3 Updated by Kara almost 5 years ago

Hi Paul,

I just checked out the latest version in the repository (r17378) and ran a few scripts that had previously caused me problems. The plotting looks great and I couldn't see any banding at the poles!! Thank you!!

One thing I thought to note <see attached files>... With certain input files (e.g. 203Ma.xy), the attached script seems to hang without finishing. A ps file is created - which I can indeed open, but it seems that a basemap isn't drawn. Yet when I use v5.2.1_r15220 there are no such problems. This same script works on other input files (e.g. 200 Ma). This probably isn't major, but I thought to flag it.

Thanks again,

#4 Updated by Paul over 4 years ago

Interesting. Nasty polygon crosses very close to the pole and hence the longitude changes too rapidly even after resampling. I added finer resampling when close to poles and it seems to work so far, but I suspect if a polygon crosses within inches of the pole then it may not be enough. Give it a try; in r17528.

#5 Updated by Joaquim over 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF