qgis / QGIS-Enhancement-Proposals

QEP's (QGIS Enhancement Proposals) are used in the process of creating and discussing new enhancements for QGIS
118 stars 37 forks source link

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

Open alexbruy opened 8 years ago

alexbruy commented 8 years ago

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:

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 commented 8 years ago

+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 https://github.com/qgis/QGIS-Enhancement-Proposals/issues/71, or mute the thread https://github.com/notifications/unsubscribe-auth/AAXS3Bg2a8jmUa4w1R7lJfGummljfr3Eks5qn_5EgaJpZM4J37jf .

ghtmtt commented 8 years ago

+1 that could be really useful

hamiltoncj commented 8 years ago

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

alexbruy commented 7 years ago

Merged in master in qgis/QGIS@2497375ee95c5eb3046a8316793adf75c4ef1768