Problem with plotting polygons using PSXY and also problem with GMTSPATIAL

Kara Matthews <[email protected]> Mon, 21 Jul 2014 01:59:38 +0000
Newsgroups gmane.comp.gis.gmt.user
Message-ID <CFF2B02C.4CAE%[email protected]>
Hello All,

I am using GMT 5.1.1 (r12972) on OSX Mavericks and am having a problem with plotting polygons (I’m using the Mercator projection). Specifically I am getting banding across my map in instances when a polygon is being cropped by the map border. It seems that the polygon is wrapping the wrong way around the world. Compare “test_0-360.pdf” (artefact in bottom right) with “test_required_plotting.pdf” (this is what I want the map to look like). A couple of my other colleagues at work are having the same problem.

To try and get around this issue I used gmtspatial and the –C option to close the polygons at the map border using my -R. This sometimes works, but not all the time. In some cases it seems to be inventing some strange polygons that I can’t account for. See "test_0-360_gmtspatial.pdf"

So when gmtspatial wasn’t working I used gmtconvert to separate my polygons out into separate files to then isolate the problem polygons. It seems that gmtspatial was making up some polygons with strange coordinates, coordinates that weren’t in the original polygon file. See prob_poly.txt that coincidentally has the same longitudes as my map region.

I was able to get around my problem by working out which polygons weren’t working (a bit of trial and error with awk and bash if statements) and then not plotting these… but my clunky work-around is not ideal for making lots of figures, or plotting lots of polygon files.

I have also attached a test script and the input files in problem_with_psxy.zip. I have currently uncommented the set of lines I needed to make my ideal figure. You should be able to run this script from the folder if needed.

Thanks kindly for any help you can offer!!

Kind regards,
Kara


---

Dr Kara J. Matthews | Postdoctoral Researcher
School of Geosciences | Faculty of Science

THE UNIVERSITY OF SYDNEY
Rm 403 | Madsen Building (F09) | The University of Sydney | NSW | 2006
E: [email protected]
T: +61 2 9351 3625
W: www.earthbyte.org

Mailing list for GMT discussions of all kinds.  If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to [email protected]
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
test_0-360.pdf (application/pdf, 27.9 KB) - not displayed
test_0-360_gmtspatial.pdf (application/pdf, 28.9 KB) - not displayed
test_required_plotting.pdf (application/pdf, 27.9 KB) - not displayed
prob_poly.txt (text/plain, 753 B)
> validTime TimePeriod <begin> TimeInstant <timePosition>600</timePosition></begin> <end> TimeInstant <timePosition>http://gplates.org/times/distantFuture</timePosition></end>
185	-43.2152768249
140	-43.240511697
140	-44.24567092
185	-44.3256301864
185	-45.1387226283
140	-45.1903580083
140	-47.4715533807
185	-47.5224983557
185	-43.2152768249


Mailing list for GMT discussions of all kinds.  If you are not sure you have found a bug, discuss it here first.
To formally report bugs or request features, please register and add New Issue on gmt.soest.hawaii.edu
To unsubscribe, send the message "signoff gmt-help" to [email protected]
Note: gmt-help will become obsolete on Sept 1, 2014 - please use forum on gmt.soest.hawaii.edu instead.
problem_with_psxy.zip (application/zip, 270.3 KB) - not displayed