Multiple faults in pslegend
David Whipp <[email protected]> Wed, 16 Jul 2014 13:50:57 +0300
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <[email protected]> |
Hi all, We’ve been trying to learn a bit about creating maps in GMT and have recently encountered some trouble trying to plot multiple faults in a map legend using pslegend. We’re able to plot multiples of other symbols as well as single faults, but we have some trouble when trying to plot 2 or more faults. For example, using pslegend to plot > S 0.1i f 0.25i/-1/0.075i 0/0/255 0.25p is fine, and shows the expected fault symbol in the legend (we have no problem adding a text label as well). If we try the same thing with multiple fault instances, such as > S 0.1i f 0.25i/-1/0.075i 0/0/255 0.25p > S 0.1i f 0.25i/-1/0.075i 0/0/255 0.25p pslegend exits with an error: > [Session pslegend (0)]: Error returned from GMT API: GMT_NOT_A_VALID_ID (30) > pslegend: GMT_psxy returned error 30. The verbose equivalent error message for the example above is > pslegend: Processing input text table data > pslegend: GMTAPI_Init_Import: Passed family = Text Table and geometry = Non-Geographical > pslegend: GMTAPI_Init_Import: Added 0 new sources > pslegend: Object ID 0 : Registered Text Table Stream 7fff7db1f370 as an Input resource with geometry Non-Geographical [n_objects = 1] > pslegend: GMTAPI_Init_Import: Added stdin to registered sources > pslegend: GMT_Init_IO: Returned first Input object ID = 0 > pslegend: GMTAPI_Begin_IO: Input resource access is now enabled [container] > pslegend: GMTAPI_Import_Textset: Passed ID = -1 and mode = 0 > pslegend: Reading Text Table from Stream 7fff7db1f370 > pslegend: GMT_End_IO: Input resource access is now disabled > pslegend: No legend height given, use an estimated height of 0.6 inches. > pslegend: Projected values in meters: -1.11319e+06 1.11319e+06 -1.11148e+06 1.11148e+06 > pslegend: Warning: not a valid number and may not be decoded properly. > pslegend: Object ID 1 : Registered Text Table Memory Reference 7ffa51422a70 as an Input resource with geometry Point [n_objects = 2] > pslegend: Successfully created a new Text Table container > pslegend: Object ID 2 : Registered Data Table Memory Reference 7ffa51422e00 as an Input resource with geometry Line [n_objects = 3] > pslegend: Successfully created a new Data Table container > psxy: History: Process -R0/5.90551/0/5.89639. > psxy: History: Process -Jx1i. > psxy: Processing input table data > psxy: Projected values in meters: 0 5.90551 0 5.89639 > psxy: GMTAPI_Init_Import: Passed family = Data Table and geometry = Line > psxy: GMTAPI_Init_Import: Added 1 new sources > psxy: GMT_Init_IO: Returned first Input object ID = 0 > psxy: GMTAPI_Begin_IO: Input resource access is now enabled [container] > psxy: GMTAPI_Import_Dataset: Passed ID = 2 and mode = 0 > psxy: Referencing data table from GMT_DATASET memory location > psxy: GMT_End_IO: Input resource access is now disabled > psxy: Plotting table 0 segment 0 > psxy: GMT_Destroy_Data: Ignored warning 25 for object 2 > pslegend: Warning: not a valid number and may not be decoded properly. > psxy: History: Process -R0/5.90551/0/5.89639. > psxy: History: Process -Jx1i. > psxy: Processing input table data > psxy: Projected values in meters: 0 5.90551 0 5.89639 > psxy: GMTAPI_Init_Import: Passed family = Data Table and geometry = Line > psxy: Object ID 3 : Registered Data Table File @GMTAPI@-000002 as an Input resource with geometry Line [n_objects = 4] > [Session pslegend (0)]: Error returned from GMT API: GMT_NOT_A_VALID_ID (30) > psxy: GMTAPI_Init_Import: Added 1 new sources > psxy: GMT_Init_IO: Returned first Input object ID = 0 > psxy: GMTAPI_Unregister_IO: Unregistering object no 3 [n_objects = 3] > pslegend: GMT_psxy returned error 30. > pslegend: GMT_Garbage_Collection: Destroying object: C=0 A=1 ID=0 W=Input F=Text Table M=Stream S=Used P=0 D=7ffa514226b0 N=(null) > pslegend: GMT_Garbage_Collection: Destroying object: C=0 A=0 ID=1 W=Input F=Text Table M=Memory Reference S=Unused P=7ffa51422a70 D=7ffa51422a70 N=(null) > pslegend: GMT_Garbage_Collection: Destroying object: C=0 A=1 ID=2 W=Input F=Data Table M=Memory Reference S=Used P=7ffa51422e00 D=7ffa51422e00 N=(null) > pslegend: GMTAPI_Garbage_Collection freed 3 memory objects > pslegend: GMTAPI_Unregister_IO: Unregistering object no 0 [n_objects = 2] > pslegend: GMTAPI_Unregister_IO: Unregistering object no 1 [n_objects = 1] > pslegend: GMTAPI_Unregister_IO: Unregistering object no 2 [n_objects = 0] > pslegend: Entering GMT_Destroy_Session Anyway, we don’t know enough about GMT to determine what we need to do to resolve this error message, so we’re hoping perhaps one of you knows how we should modify our GMT script to plot multiple faults in the legend. I’ve attached a simple example script that should reproduce the multiple fault plotting issue. Must everything is commented out for now, except for an attempt to plot two faults. Cheers, Dave Whipp and Niclas Blomqvist 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.
pslegend_test.sh
(application/octet-stream, 1.9 KB)
#!/bin/bash # # pslegend_test.sh - A test of plotting faults using pslegend # # dwhipp 07.14 # Make basemap psbasemap -Ba5f5 -JM15 -R-10/10/-10/10 -L-72/-7.5/32/200 -Yc -Xc -K > test.ps # Plot faults using pslegend pslegend -Vd -R-10/10/-10/10 -JM15 -F -D-10/-10/7/4/BL -C0.1i/0.1i -L1.2 -P -O -K <<EOF >>test.ps # # Legend test for pslegend # G is vertical gap, V is vertical line, N sets # of columns, D draws horizontal line. # H is header, L is label, S is symbol, T is paragraph text, M is map scale. # #G -0.1i #H 16 Times-Roman Legend #D 0.2i 1p N 1 #V 0 1p #S 1p f+r+s 12p black 0.5p,black 0.3i "left lateral" #S 1p f+l+s 16p purple 0.5p,purple 0.3i right lateral #V 0 1p #D 0.2i 1p #N 1 #M 0 0 1000+u f #G 0.05i #S 1p f 12p/-1/4p black 0.5p,black 0.3i "left lateral" #S 0.1i c 0.15i p300/12 0.25p 0.3i This circle is hachured #S 0.1i c 0.15i p300/12 0.25p 0.3i This circle is hachured #S 0.1i c 0.15i p300/12 0.25p 0.3i This circle is hachured #S 0.1i e 0.15i 255/255/0 0.25p 0.3i This ellipse is yellow #S 0.1i e 0.15i 255/255/0 0.25p 0.3i This ellipse is yellow #S 0.1i e 0.15i 255/255/0 0.25p 0.3i This ellipse is yellow #S 0.1i w 0.15i 0/255/0 0.25p 0.3i This wedge is green #S 0.1i w 0.15i 0/255/0 0.25p 0.3i This wedge is green #S 0.1i w 0.15i 0/255/0 0.25p 0.3i This wedge is green S 0.1i f+r+s 0.25i/-1/0.075i 0/0/255 0.25p 0.3i Right lateral S 0.1i f+l+s 0.25i/-1/0.075i 0/0/255 0.25p 0.3i Left lateral #S 0.1i f 0.25i/-1/0.075i 0/0/255 0.25p #S 0.1i - 0.15i - 0.25tap 0.3i A contour #S 0.1i - 0.15i - 0.25tap 0.3i A contour #S 0.1i - 0.15i - 0.25tap 0.3i A contour #S 0.1i v 0.25i/0.02i/0.06i/0.05i 255/0/255 0.25p 0.3i This is a vector #S 0.1i v 0.25i/0.02i/0.06i/0.05i 255/0/255 0.25p 0.3i This is a vector #S 0.1i v 0.25i/0.02i/0.06i/0.05i 255/0/255 0.25p 0.3i This is a vector #S 0.1i i 0.15i 0/255/255 0.25p 0.3i This triangle is boring #S 0.1i i 0.15i 0/255/255 0.25p 0.3i This triangle is boring #S 0.1i i 0.15i 0/255/255 0.25p 0.3i This triangle is boring EOF