# What's going on here with grdview?

**URL:** <https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365>\
**Category:** Q&A\
**Created:** [February 19, 2021, 6:41pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365 "2021-02-19T18:41:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 19, 2021, 6:41pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/1 "2021-02-19T18:41:50Z")

</div>

I’m trying to plot a perspective view of the Innsbruck, Austria area.

But for some reason the upper part remains invisible:

 ![inn_true_colors_shaded](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/34f3ebb1e867b6f5610fac2be054ee8b93bec09d.jpeg)

I don’t really understand why this doesn’t work.

Some code to play with:

[inn\_color.tif](https://forum.generic-mapping-tools.org/uploads/short-url/wNxAJF1RgQdslyUdez81KT085mR.tif) (334.3 KB)

```
gmt begin inn_true_colors_shaded jpg
  gmt basemap -JL11.5/47/46.5/47.5/20c -R10.5/12.2/46.7/47.8 -B -p205/35
  gmt grdview @earth_relief_03s -Ginn_color.tif -I+a315+ne0.3+m0 -JZ0.6c -Qi300 -p
gmt end show

```

---

<div class="post-metadata">

**Author:** ![MarceloBanik](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/marcelobanik/32/479_2.png) [@MarceloBanik](https://forum.generic-mapping-tools.org/u/MarceloBanik)\
**Post date:** [February 19, 2021, 7:52pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/2 "2021-02-19T19:52:19Z")

</div>

Same thing here.  
It is not a solution, but I noted that if using -JM20c it works.

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 19, 2021, 10:05pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/3 "2021-02-19T22:05:52Z")

</div>

Thank you for confirming this @MarceloBanik. Pinging @pwessel and @Joaquim for some ideas?

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 20, 2021, 3:56pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/4 "2021-02-20T15:56:51Z")

</div>

Still not sure what’s going on here. Some further experimentation:

`-p170/45`

 ![p170_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/d89cbba0b9555cc7d44989d7c90d2ab6483e597f.jpeg)

`-p200/45`

 ![p200_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/0c188fb40a0dc47360051ab311e0e76a27125f40.jpeg)

`-p350/45`

 ![p350_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/139b6bf2271434aa21ad17aea7b20858389391cb.jpeg)

Code to play with:

[test\_img.tiff](https://forum.generic-mapping-tools.org/uploads/short-url/9XeXG337O3dHVu43RBUiElKmLrN.tiff) (148.0 KB)

```
gmt begin p170_45 png
  gmt basemap -JL11.5/47/46.5/47.5/20c -R10.5/12.2/46.7/47.8 -B -p170/45
  gmt grdview @earth_relief_03s -Gtest_img.tiff -I+a315+ne0.2+m0 -JZ0.6c -Qi150 -p
gmt end show

```

Using GMT version: 6.2.0\_3b552d3\_2021.02.19  
Using GhostScript version: 9.50

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [February 20, 2021, 5:03pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/5 "2021-02-20T17:03:08Z")

</div>

Something is weird with that tif file

```auto
grdinfo inn_color.tif
inn_color.tif: Title: Grid imported via GDAL
inn_color.tif: Command:
inn_color.tif: Remark:
inn_color.tif: Pixel node registration used [Cartesian grid]
inn_color.tif: Grid file format: gd = Import/export through GDAL
inn_color.tif: x_min: 10.5 x_max: 12.2 x_inc: 0.00132501948558 name: x n_columns: 1283
inn_color.tif: y_min: 46.7 y_max: 47.8 y_inc: 0.000899427636958 name: y n_rows: 1223
inn_color.tif: v_min: 39 v_max: 238 name: z
inn_color.tif: scale_factor: 1 add_offset: 0
+proj=eqc +lat_ts=0 +lat_0=0 +lon_0=11.35 +x_0=0 +y_0=0 +R=6371007.181 +units=m +no_defs

gdalinfo inn_color.tif
...
Origin = (10.500000000000000,47.799999999999997)
Pixel Size = (0.001325019485581,-0.000899427636958)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 10.5000000, 47.8000000) ( 11d21' 0.34"E, 0d 0' 1.55"N)
Lower Left ( 10.5000000, 46.7000000) ( 11d21' 0.34"E, 0d 0' 1.51"N)
Upper Right ( 12.2000000, 47.8000000) ( 11d21' 0.39"E, 0d 0' 1.55"N)
Lower Right ( 12.2000000, 46.7000000) ( 11d21' 0.39"E, 0d 0' 1.51"N)
Center ( 11.3500000, 47.2500000) ( 11d21' 0.37"E, 0d 0' 1.53"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Undefined

```

Even GDAL cannot convert from `dd.xxxx` to `dd:mm:ss`?

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 20, 2021, 5:42pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/6 "2021-02-20T17:42:10Z")

</div>

Hi @Joaquim, thank you for looking into this. I made a .tiff from scratch so no weird data in the file but the problem persists:

 ![tile_p225_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/a01a601bf6170d45440d0fb72ddf5dc3a7f3fecb.jpeg)

Have a try for yourself:

[test\_tile\_2520.tiff](https://forum.generic-mapping-tools.org/uploads/short-url/rmxExvQA3w8tFeFfsiXhnzCRSPm.tiff) (398.4 KB)

```
gmt begin tile_p225_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p225/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

```

When I try to use it with the subplot machinery it gets really wild:

 ![views](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/e67b7951c74ae857b2715cef5727ba55a65cd1e3.jpeg)

But I think there might be a problem with me using the subplot machinery or the subplot machinery itself as well. When I plot the different perspective views separately they only show the behavior of the missing areas but are scaled correctly:

 ![tile_p180_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/cb25a7eaa40497fa42f320e0e7e889ea14eb4caa.jpeg)  
`-p180/45` this appears to be correct

 ![tile_p225_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/a01a601bf6170d45440d0fb72ddf5dc3a7f3fecb.jpeg)  
`-p225/45` NE corner missing

 ![tile_p270_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/f3ab9c1b175def7c651d52fb2ab9e1124471aa2e.jpeg)  
`-p270/45` southern rim missing, northern map frame is incomplete

 ![tile_p315_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/6718f907226b48ccba46520d4c28b9e128772b20.png)  
`-p315/45` NE corner missing

 ![tile_p0_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/8416b939dbd8b0d17285e499b860fd34f2b0fd60.jpeg)  
`-p0/45` this appears to be correct

 ![tile_p45_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/7788c733e1ff871bb62e5454e560752241278bc7.jpeg)  
`-p45/45` NE corner missing

 ![tile_p90_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/35fcf088ac545e4585b39dee83dd5e7d0ab49c24.jpeg)  
`-p90/45` southern rim missing, northern map frame is incomplete

 ![tile_p135_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/47f930c613c03f65ce5557e2d1225e4e8d01f411.png)  
`-p135/45` NE corner missing

All the code to play with:

```
gmt begin tile_p0_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p0/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

gmt begin tile_p45_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p45/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

gmt begin tile_p90_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p90/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

gmt begin tile_p135_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p135/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

gmt begin tile_p180_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p180/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

gmt begin tile_p225_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p225/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

gmt begin tile_p270_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p270/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

gmt begin tile_p315_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/20/40/60 -B -p315/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

```

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [February 20, 2021, 7:11pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/7 "2021-02-20T19:11:32Z")

</div>

There are weird things happening with images and projections. I already spent days trying to debug it but the [**pad**](https://github.com/GenericMappingTools/gmt/issues/4358) is killing me. Note that this works, but not if I try to join it in a command like yours.

```auto
grdproject @earth_relief_10m -R0/20/40/60 -J+proj=lcc+lon_0=10+lat_0=50+lat_1=46.7+lat_2=55.3+x_0=0+y_0=0+ellps=GRS80+units=m+no_defs -Glixo.grd
grdproject [WARNING]: x_inc does not divide 180; geographic boundary condition changed to natural.

grdview lixo.grd -JX10 -Baf -BWSen -n+a -p205/35 -Qi300 -I+a315+ne0.3+m0 -Gtest_tile_2520.tiff -P > lixo.ps

```

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 20, 2021, 8:29pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/8 "2021-02-20T20:29:26Z")

</div>

Ok, do you have an idea how to work around this for the moment?

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [February 20, 2021, 8:51pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/9 "2021-02-20T20:51:26Z")

</div>

Well, since my last example seems to work you may use it, together with what is done in example 28, as a workaround.

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 20, 2021, 9:12pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/10 "2021-02-20T21:12:14Z")

</div>

@Joaquim would you kindly explain to me how [example 28 “Mixing UTM and geographic data sets”](https://docs.generic-mapping-tools.org/latest/gallery/ex28.html) would help me?

Because when I use a rectangular projection like `-JM` it works out of the box:

 ![JM_tile_p225_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/ea3c904e29c99fb8762babc3281f48e39e638ca2.jpeg)

```
gmt begin JM_tile_p225_45 png
  gmt basemap -JM5c -R0/20/40/60 -B -p225/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

```

So I thought I give `-JL -R+r` a try but I’m not sure I understand what controls the placement of the draped image:

 ![pR_tile_p225_45](https://canada1.discourse-cdn.com/flex047/uploads/gmt/original/1X/d6a357d3a509690032988374de2f2aea8d27ad11.jpeg)

```
gmt begin pR_tile_p225_45 png
  gmt basemap -JL10/50/46.7/55.3/5c -R0/40/20/60+r -B -p225/45
  gmt grdview @earth_relief_10m -Gtest_tile_2520.tiff -I+a315+ne0.2+m0 -JZ0.4c -Qi300 -p
gmt end show

```

---

<div class="post-metadata">

**Author:** ![Joaquim](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/joaquim/32/16_2.png) [@Joaquim](https://forum.generic-mapping-tools.org/u/Joaquim)\
**Post date:** [February 20, 2021, 10:01pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/11 "2021-02-20T22:01:19Z")

</div>

Well, the idea is: if by projecting first and get cartesians the draping works then the technique in ex28 would allow drawing a geographic frame, if that is desired.

---

<div class="post-metadata">

**Author:** ![KristofKoch](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/kristofkoch/32/314_2.png) [@KristofKoch](https://forum.generic-mapping-tools.org/u/KristofKoch)\
**Post date:** [February 20, 2021, 10:02pm UTC](https://forum.generic-mapping-tools.org/t/whats-going-on-here-with-grdview/1365/12 "2021-02-20T22:02:30Z")

</div>

Ah, now I got it. Thank you!
