Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support draping images over parts of a grid with grdview #3287

Open
KristofKoch opened this issue May 8, 2020 · 9 comments
Open

Support draping images over parts of a grid with grdview #3287

KristofKoch opened this issue May 8, 2020 · 9 comments
Labels
feature request Request a new feature

Comments

@KristofKoch
Copy link
Contributor

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 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 (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

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
@KristofKoch
Copy link
Contributor Author

I missed to provide the context – it came from the forum.

@joa-quim
Copy link
Member

Well the docs only promise that different resolutions are allowed but in this case the image covers only a sub-region of the grid.

Off course this case should be allowed too but grdview is awfully complicated and it processing the images as if they were grids, which adds a lot of memory overhead (each byte is represented in a float).

Using 3 grids to represent an image is something we should really drop off. It comes form last century when we couldn't deal with images.

@joa-quim joa-quim mentioned this issue May 21, 2020
35 tasks
@stale
Copy link

stale bot commented Aug 22, 2020

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Aug 22, 2020
@joa-quim joa-quim removed the stale This will not be worked on label Aug 24, 2020
@stale
Copy link

stale bot commented Nov 29, 2020

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Nov 29, 2020
@seisman seisman closed this as completed Nov 29, 2020
@seisman seisman reopened this Nov 29, 2020
@stale stale bot removed the stale This will not be worked on label Nov 29, 2020
@stale
Copy link

stale bot commented Jun 2, 2021

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@stale stale bot added the stale This will not be worked on label Jun 2, 2021
@KristofKoch
Copy link
Contributor Author

Is there still interest in placing images on parts of a grid? Like a georeferenced satellite images over a larger grid to provide context to the image? I could still make use of this …

@stale stale bot removed the stale This will not be worked on label Jun 3, 2021
@maxrjones
Copy link
Member

Is there still interest in placing images on parts of a grid? Like a georeferenced satellite images over a larger grid to provide context to the image? I could still make use of this …

I agree that this would be useful.

@KristofKoch
Copy link
Contributor Author

Great. @meghanrjones, would you recommend to keep this issue open or write a new feature request?

@maxrjones
Copy link
Member

Great. @meghanrjones, would you recommend to keep this issue open or write a new feature request?

I would keep this open, but from Joaquim's comments there may also be prerequisite refactoring of the handling of images. I am not familiar with what would be involved.

@maxrjones maxrjones added the feature request Request a new feature label Sep 22, 2021
@maxrjones maxrjones changed the title grdview: incorrectly scaled georef image when draped over relief grid with different resolution Support draping images over parts of a grid with grdview Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a new feature
Projects
None yet
Development

No branches or pull requests

4 participants