Re: Problem with plotting polygons using PSXY and also problem with GMTSPATIAL

Christian Heine <[email protected]> Wed, 23 Jul 2014 23:40:16 +0200
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
Hi Kara,

> 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.

I just ran your test.sh script using Version 5.1.2_r13178 [64-bit] on OS 10.9.4 and get the attached result (test_0-360_chhei_crop.pdf). It is quite similar to the look of your 'desired' map. The only difference between your desired map and the one I generated using your script is the central part where there are white/unfilled  patches (missing polygons?) as opposed to filled space in your required map.

Plotting COBreconstructed_${age}.00Ma.xy (2.pdf) and WARSreconstructed_${age}.00Ma.xy (1.pdf) independently results in the attached maps. 

For what it's worth it might be helpful to dump the reconstructed data as *.shp file and throw this into QGIS and do basic geometry checking: In QGIS there's the menu Vector -> Check Geometry Validity (btw this should also work on OGR GMT files). But I suspect that this is more something related to dateline crossings.

Also, I ran your polygons through gmtspatial -Q+ for a handedness check - some few of your polygons are CW whereas the others are CCW handed. Not sure whether this causes GMT to misbehave (wouldn't assume so). 

When exporting from GPlates, I can highly recommend to use the GMT OGR format (*.gmt) as this also exports the GPlates Feature ID which lets you search and identify a single rogue feature much much easier. 

Possible workaround: ogr2ogr from the GDAL library has a "[-clipsrc [xmin ymin xmax ymax]" option which you can also use to clip the data.

Sorry for not being able to help with specific debugging info with your setup. Maybe an update to the recent SVN versions will fix some of the problems? 

Greetings from NL,
Christian



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.



>  
> 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><test_0-360_gmtspatial.pdf><test_required_plotting.pdf><prob_poly.txt><problem_with_psxy.zip>


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_chhei_crop.pdf (application/pdf, 8.3 KB) - not displayed
1.pdf (application/pdf, 2.3 KB) - not displayed
2.pdf (application/pdf, 8.1 KB) - not displayed
signature.asc (application/pgp-signature, 881 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQIcBAEBAgAGBQJT0CvAAAoJEJsl3M9kiNJoC48P/1elJr6ZMDzuOJrDFmCIDozn
ypcdsXBlkydJ3ScLnrh0ndV4PDPz+3hG07djlQnlvlO9Wh7TlJGWYD5XEA5Zxg4L
IUBRoJJKzTzkW/o+1TUbDC2RLYX6V515wvXfKygwVwiPgPgW7yReVQL1u77/lcsF
W1mxIBf8TB5p+lqgdpdG2CG7vrWs85NEcBLCMKrA0LJw4IRmWrDn8ttFwPkFYBZw
LPkPpi8K2RYbH0kHfgTXirH48qj/wsAQh8BAdCf7zM0fvExbNc10ROvqEowONDM8
k32PIve4hAjGB+dBBg0TkECf2yUio4Uj2IGVgAE/s5Gkos+LgCfi5hhH6xK1N+/w
3MdysYWcxdSYQsiiEPkPUNCGHn2jH1091NfeeT27CRpiTSzIPLjsyHQVKKzqa6Sz
2kgkR68VTRilO/Hir6wV1ht7qwq/rI4e3KuqDMC6HPwN+zJXikDJq1u3djoqQAWz
SYQ0x27IdxJvJEl2a/walGbfIM+gcVfXVOF/FrtSiHyd9VOZty7sYff3DklCxJx9
jxKspTT+pntODXIatPZ/cGgFiW7p8Hk8EYdpDIQt17oF4caKr9VFb3/6fJXYr6SN
8rfO2X42B+qcmJyEH9x5S94wAvghAURu9aXB7m8XocUmWtCvyYCnZ/3vaWWn2Tl0
G68YTh2C4vcq49zeaeeR
=0hiD
-----END PGP SIGNATURE-----