Plotting data on 3D map issue in perspective view

Hi,
I am trying to plot 3D perspective map of an area. I want to add some data points on this map. The following way I used;

gmt begin
Proj="-JM10c"
Region="-R134/140/25/33"
Region3D="-R134/140/25/33/-6500/1000"		
Perspective="-p130/20"						
Proz="-JZ3c"
gmt figure example_map png
# extract relief data for area
gmt grdcut @earth_relief_01m -R134/140/25/33 -Gexample_relief.grd
# add coast features on map
gmt coast $Proj $Region3D $Perspective/0 $Proz -Na -W0.2p,black -Gyellow
gmt grdview example_relief.grd $Proj $Region3D $Perspective $Proz -Ctopo -I -N-6500+glightgray -Qi300 -Wf0.5,black -Ba2  -Bza1000+l"Height (m)"

# add points on map. using grdtrack to get 3rd column value
gmt grdtrack $Limit -Gexample_relief.grd -sa | gmt plot3d points_data $Proj $Region3D $Perspective $Proz -Sc0.08c -Gred
gmt end

Points_data: points_data.dat (11.3 KB)

I used points_data(long,lat) to add these points on map. To get 3rd column value in addition to (long,lat), I try to use grdtrack.

But I am getting problem in using grdtrack to get 3rd column value. What is the issue in grdtrack command which I used above (gmt grdtrack $Limit -Gexample_relief.grd -sa) and suggest the correct way to do this using grdtrack. Thanks.

I assume you followed this example already

What ˋ$Limit` is supposed to be ?

Sorry its typing error, the $Limit —> Region="-R134/140/25/33"

Try this line instead ( with points_data.dat in grdtrack)

gmt grdtrack points_data.dat $Limit -Gexample_relief.grd -sa | gmt plot3d $Proj $Region3D $Perspective $Proz -Sc0.08c -Gred

@Esteban82

Thanks for your help, it solve the issue. Figure is attached which shows points stick to surface.

I also used grdtrack command from some other source. Can you explain little bit about the parameter (-sa) in grdtrack command?

Another thing, without getting column 3 values using grdtrack, whether user can use original depths of earthquakes in place of 3rd column values (from grdtrack) for plotting such 3D map?

I’m affraid I don’t record it now. But I am sure that in the docs it is well explained.

I am not sure if I understand well. You could use the original depth. But be careful with the units. You should convert the depth from km to m (to plot in the above figure where the vertical scale is in meters).

  1. It cannot be that hard to click on the -sa link in the docs and read?
  2. If you have a files with lon, lat, depth points then you have no grid so grdtrack is obviously not involved at all.

Hi,

  1. I checked the docs earlier, there is a parameter (-Smethod/modifiers) is available which I tested but gives error. So I asked for (-sa).

data.dat (14.6 KB)

2a. Using earthquakes depth with (long,lat), it gives error in plot. Figure 1 is plotted using data.dat(long,lat,depth) where depth is in km and height is in (m). I think similar way is used where height is in (m) and earthquakes depth in (km) available (https://www.earthinversion.com/utilities/how-to-plot-the-earthquake-data-on-three-dimensional-topographic-map/).

gmt begin
Proj="-JM10c"
Region="-R134/140/25/33"
Region3D="-R134/140/25/33/-6500/1000"		
Perspective="-p130/20"						
Proz="-JZ3c"
gmt figure example_map png
gmt grdcut @earth_relief_01m -R134/140/25/33 -Gexample_relief.grd
gmt grdview example_relief.grd $Proj $Region3D $Perspective $Proz -Ctopo -I -N-6500+glightgray -Qi300 -Wf0.5,black -Ba2  -Bza1000+l"Height (m)"
gmt plot3d data.dat $Proj $Limit3D $Perspective $Proz -Sc0.2c -Gred     
gmt end

Figure 1

“So if using earthquakes depth in (km) and height in (m) is correct then how to correct Figure 1 where earthqaukes appear as in air not stick to surface?”

2b. Figure 2 is plotted using data.dat(long,lat,depth) where earthquakes depth converted to (m) same unit as height (m).
Figure 2

“Why few data appear in Figure 2 if both earthquakes and height is in same unit of (m). What may be the possible issue?”

because your depths in data.dat are positive while gmt expects negative depths? “Positive depths” are altitudes (above the sea level) in this context.

you can plot3d your data alone with axes/coordinates and an appropriate Z range (0/1000) to get an overview.

even if you get these depths negative, they’ll “hang” well above the sea floor as far as I can understand by manually checking your data.dat, as depths on the example_relief.grdare below -1000 m, many close to -3000…-4000…-5000…-6000 m.

from your www.earthinversion.com link:

Since the depths of the event ranges up to 180 km, we had to constrain it to show it within the range of our chosen maximum depth for the three-dimensional map. We project the depths in the range of 0 to the maximum depth of the displayed topography.

if your event depths in data.dat are positive kilometers, many can occur way below the sea floor depth of your grid file.

@mkononets

Thanks for your clarification. I think if user plot map using depths (either + or -), plot have an error in which events appear in air not stick to surface.

If user keep depth and height in same units then depth values become higher > height range values, so few events displayed on map which have depth values within height range.

So in such case, I think events(long,lat) data with grdtrack (to get z value) is a suitable option instead of using events depth.