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

WIP r.external: transfer_colormap added #337

Merged
merged 1 commit into from Mar 5, 2020

Conversation

landam
Copy link
Member

@landam landam commented Feb 9, 2020

Color maps seems to be not transferred when linking raster data using r.external.

r.in.gdal in=/home/user/geodata/sentinel/sample/L2A_T32UPB_20170706T102021_B04_10m.jp2 out=b4
r.colors.out b4
1 0:0:0
17266 255:255:255
nv 255:255:255
default 255:255:255

vs.

r.external in=/home/user/geodata/sentinel/sample/L2A_T32UPB_20170706T102021_B04_10m.jp2 out=b4l
r.colors.out b4l
nv 255:255:255
default 255:255:255

This causes that a linked raster map is displayed in map canvas as transparent which is very confusing for the user.

New function transfer_colormap() was just taken from r.in.gdal. This solution cannot be accepted since it introduces a code duplication. Unfortunately there is already quite significant code duplication speaking about GDAL-based modules (r.in.gdal, r.external, v.in.ogr, v.external). What would probably feasible to create a new gdalioib which could be used by these modules.

Any opinion?

@landam landam requested review from metzm and neteler February 9, 2020 11:45
@landam landam added the help wanted Extra attention is needed label Feb 9, 2020
@landam landam added this to the 7.8.3 milestone Feb 9, 2020
Copy link
Contributor

@metzm metzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me.
However, you are right that this causes more code duplication. I am not sure if a new GRASS lib like gdaliolib is needed or if we can put some functionality into the separate libs rasterlib, vectorlib, and projlib (for the nearly identical projection checks in the for modules). This should go into a separate new issue.

@landam landam merged commit eb30763 into OSGeo:master Mar 5, 2020
@landam landam deleted the r-external-colormap branch March 5, 2020 13:49
landam added a commit that referenced this pull request Mar 5, 2020
HuidaeCho pushed a commit to HuidaeCho/grass that referenced this pull request Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants