GenericMappingTools / GenericMappingTools/gmt

Support draping images over parts of a grid with grdview

Open
#3,287 9 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

**Description of the problem**

When draping a georeferenced image over some relief and they have different resolutions the image is stretched to fill the whole plot area instead of a correctly scaled placement.

[The docs for `grdview -G`](https://docs.generic-mapping-tools.org/latest/grdview.html#g) allow for different scales:

> The drapegrid may be of a different resolution than the reliefgrid.

**Full script that generated the error**

```
#!/usr/bin/env bash

gmt begin draped_img
gmt grdview -JL-24.9/16.55/16.3/16.7/20c -R-25.14/16.75/-24.8/16.95r CV.grd -Ba10mg10m -I+ -Gcaboverde_mod.tif -Qi150
gmt plot land_polygons_osm_caboverde.bf2 -bi2f -W0.5p,red
gmt end show
```

The files `CV.grd`, `caboverde_mod.tif` and `land_polygons_osm_caboverde.bf2` are provided in
[data.zip](https://github.com/GenericMappingTools/gmt/files/4597984/data.zip) (467 KB)

`CV.grd` is a subset of the GMT provided 3 arc second global relief, `caboverde_mod.tif` is a simplified georeferenced tiff image, and `land_polygons_osm_caboverde.bf2` is the coast outline from OpenStreetMap to have a precise coast line known to fit with the SRTM data.

**Actual outcome**

![draped_img](https://user-images.githubusercontent.com/45796239/81387677-5be17900-9117-11ea-9a99-6b733767f251.jpg)

Note the mismatch between the black coast line with blue water and the shaded terrain with the red coast line. The image (blue water and black coast line) appears to be stretched to fill the whole plot area instead of being correctly sized.

**Expected outcome**

I expected the image to be scaled (shrunk in this case) to the correct size when draped over the relief grid and not stretched to fill the whole plot area.

**System information**

* Operating system: macOS 10.15.4
* GMT version (`gmt --version`): tested in
* 6.0.0
* 6.1.0_9c88924_2020.05.06

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.