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

QEP 71: Save/restore colorramp name for singleband pseudocolor renderer #71

Open
alexbruy opened this issue Sep 8, 2016 · 4 comments
Open

Comments

@alexbruy
Copy link
Contributor

alexbruy commented Sep 8, 2016

QGIS Enhancement 71: Save/restore colorramp name for singleband pseudocolor renderer

Date 2016/09/08

Author Alexander Bruy (@alexbruy)

Contact alexander dot bruy at gmail dot com

Maintainer @alexbruy

Version QGIS 3.0

Summary

Currently "Singleband Pseudocolor" renderer does not save name of the color ramp used for classification. So when user worked with multiple rasters and wants to modify classification settings for one of the rasters, he may forgot which color ramp was used for current raster.

Proposed Solution

This can be fixed easily by saving not only color map but also name of the original color ramp used for classification. Name of the color ramp also should be exported to the QML file and restore from it when style applied to raster layer.

Draft implementation can be found at https://github.com/alexbruy/QGIS/tree/save-colorramp

Affected Files

Affected files are:

  • src/core/raster/qgsrastershader.cpp
  • src/core/raster/qgscolorrampshader.h
  • src/core/raster/qgscolorrampshader.cpp
  • src/core/raster/qgssinglebandpseudocolorrenderer.cpp
  • src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp

Also colorrampshader element of the QML files will be modified with addition of new attribute containing name of the color ramp.

Backwards Compatibility

Backward compatibility will be kept. New QML files will have additional attribute, if this attribute is not found — default color ramp will be used.

Votes

(required)

@NathanW2
Copy link
Member

NathanW2 commented Sep 8, 2016

+1 that always seemed strange to me

On Thu, 8 Sep 2016 10:23 pm Alexander Bruy notifications@github.com wrote:

QGIS Enhancement: Save/restore colorramp name for singleband pseudocolor
renderer

Date 2016/09/08

Author Alexander Bruy (@alexbruy https://github.com/alexbruy)

Contact alexander dot bruy at gmail dot com

Maintainer @alexbruy https://github.com/alexbruy

Version QGIS 3.0
Summary

Currently "Singleband Pseudocolor" renderer does not save name of the
color ramp used for classification. So when user worked with multiple
rasters and wants to modify classification settings for one of the rasters,
he may forgot which color ramp was used for current raster.
Proposed Solution

This can be fixed easily by saving not only color map but also name of the
original color ramp used for classification. Name of the color ramp also
should be exported to the QML file and restore from it when style applied
to raster layer.

Draft implementation can be found at
https://github.com/alexbruy/QGIS/tree/save-colorramp
Affected Files

Affected files are:

  • src/core/raster/qgsrastershader.cpp
  • src/core/raster/qgscolorrampshader.h
  • src/core/raster/qgscolorrampshader.cpp
  • src/core/raster/qgssinglebandpseudocolorrenderer.cpp
  • src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp

Also colorrampshader element of the QML files will be modified with
addition of new attribute containing name of the color ramp.
Backwards Compatibility

Backward compatibility will be kept. New QML files will have additional
attribute, if this attribute is not found — default color ramp will be used.
Votes

(required)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#71, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAXS3Bg2a8jmUa4w1R7lJfGummljfr3Eks5qn_5EgaJpZM4J37jf
.

@ghtmtt
Copy link

ghtmtt commented Sep 8, 2016

+1 that could be really useful

@hamiltoncj
Copy link

+1 that issue has frequently caused me problems. I hope it will be fixed.

@alexbruy
Copy link
Contributor Author

alexbruy commented Nov 2, 2016

Merged in master in qgis/QGIS@2497375

@NathanW2 NathanW2 changed the title Save/restore colorramp name for singleband pseudocolor renderer QEP 71: Save/restore colorramp name for singleband pseudocolor renderer Jan 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants