Oblique Mercator with depth - 3D perspective view

Added by Matthew 8 months ago

Hi,

I am trying to make a 3D Oblique Mercator map projection.
I have succeeded using a standard Mercator projection, but not with Oblique Mercator projection (-Jo). GMT is crashing with a segmentation fault.

Example:
gmt psbasemap -JM5c -JZ-10c -R10/20/20/40/1/70 -p-160/25 -BNESWZ4+b -Bpxa2g1+l"Longitude" -Bpyagf1+l"Latitude" -Bpza10g5+l"Depth, km" -X4c -Y1c -K -P -V > test.ps
open test.ps

Is it possible to do similar using -JO instead?

GMT is version 5.4.2 running on macOS Sierra.

Sincerely,
Matthew


Replies (3)

RE: Oblique Mercator with depth - 3D perspective view - Added by Paul 8 months ago

Should be, but you will need to work on your -R option since it needs to be in the lower-left/upper-right format, and this also depends on what your oblique pole is. See the example in the cookbook under oblique mercator.

RE: Oblique Mercator with depth - 3D perspective view - Added by Matthew 8 months ago

Dear Paul,

Thank you for your response. Here is a more clear example of the problem. These are four examples, all work except the last:

gmt pscoast -R270/20/305/25r -JOc280/25.5/22/69/4.8i -Dl -A250 -Glightgray -W0.25p -P -V -Tf301.5/23/0.4i/2 -BNESW -Bpxa2g1+l"Longitude" -Bpya2g1+l"Latitude" > oblique.ps
open oblique.ps

gmt pscoast -R270/20/305/25r -JOc280/25.5/22/69/4.8i -p-160/25 -Dl -A250 -Glightgray -W0.25p -P -V -Tf301.5/23/0.4i/2 -BNESW -Bpxa2g1+l"Longitude" -Bpya2g1+l"Latitude" > oblique-p.ps
open oblique-p.ps

gmt psbasemap -JM5c -JZ-10c -R10/20/20/40/1/70 -p-160/25 -X4c -Y1c -K -P -V -BNESWZ4+b -Bpxa2g1+l"Longitude" -Bpya2g1+l"Latitude" -Bpza10g5+l"Depth, km" > mercator-3d.ps
open mercator-3d.ps

gmt pscoast -R270/20/305/25/0/70r -JOc280/25.5/22/69/4.8i -JZ-5c -p-160/25 -Dl -A250 -Glightgray -W0.25p -P -V -Tf301.5/23/0.4i/2 -BNESWZ4+b -Bpxa2g1+l"Longitude" -Bpya2g1+l"Latitude" -Bpza10g5+l"Depth, km" > oblique-3d.ps
open oblique-3d.ps

The last one gives a segmentation fault:

$ gmt pscoast -R270/20/305/25/0/70r -JOc280/25.5/22/69/4.8i -JZ-5c -p-160/25 -Dl -A250 -Glightgray -W0.25p -P -V -Tf301.5/23/0.4i/2 -BNESWZ4+b -Bpxa2g1+l"Longitude" -Bpya2g1+l"Latitude" -Bpza10g5+l"Depth, km" > oblique-3d.ps
pscoast: Warning: spherical approximation used!
pscoast: GSHHG version 2.3.7
Derived from World Vector Shoreline, CIA WDB-II, and Atlas of the Cryosphere
Processed by Paul Wessel and Walter H. F. Smith, 1994-2017
pscoast: Working on bin # 74
ERROR: Caught signal number 11 (Segmentation fault) at
0 libgmt.5.4.2.dylib 0x000000010a3c3701 gmt_geo_to_xy_line + 65
1 ? 0x0000000000000000 0x0 + 0
Stack backtrace:
0 libgmt.5.4.2.dylib 0x000000010a2bcf33 sig_handler + 579
1 libsystem_platform.dylib 0x00007fff8da6eb3a _sigtramp + 26
2 ?
0x0000000000000000 0x0 + 0
3 libgmt.5.4.2.dylib 0x000000010a3e5bf6 plot_map_lonline + 70
4 libgmt.5.4.2.dylib 0x000000010a3e5941 gmt_linearx_grid + 609
5 libgmt.5.4.2.dylib 0x000000010a3e6d20 gmt_map_basemap + 3888
6 libgmt.5.4.2.dylib 0x000000010a53daed GMT_pscoast + 17309
7 libgmt.5.4.2.dylib 0x000000010a2cbfa0 GMT_Call_Module + 272
8 gmt 0x000000010a2b516a main + 1290
9 libdyld.dylib 0x00007fff8d85f235 start + 1

Am I using wrong parameters? Anything I can do to fix this?

Thank you for your help.
Sincerely,
Matthew

RE: Oblique Mercator with depth - 3D perspective view - Added by Joaquim 8 months ago

The last one works fine with trunk (developing) version, so whatever caused it seams to have been fixed.

(1-3/3)