[Qgis-user] Psuedo-color raster legends

Fernando M. Roxo da Motta petro at roxo.org
Wed Nov 4 07:44:43 PST 2015


On Wed, 04 Nov 2015 15:23:53 +0200, Benoit de Cabissole
<benoit-3 at bc-consult.com> wrote:


>  
> 
> Hi Robin, 
> 
> Regarding your point 1 below, please see the latest version (0.9.0) of
> "Color Scale Bar for One-Band Rasters" (bccscbar) at
> http://www.bc-consult.com/free/bccscbar.html [3]. It is now possible
> to use the currently selected raster from the Layers panel. 

  I think this is a very interesting tool to have available.   I
downloaded the last available version from that site and installed in
my computer, a Xubuntu 14.0 64 bits running Qgis 2.12. When I opened
the plugin manager and activated it I could find it under "raster"
menu, as described.   I closed Qgis and opened it again, and I got the
following:

=================8<--------------------------
Couldn't load plugin bccscbar due to an error when calling its
classFactory() method

ImportError: No module named resources_rc
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 306, in
startPlugin plugins[packageName] = package.classFactory(iface)
  File "/home/roxo/.qgis2/python/plugins/bccscbar/__init__.py", line
64, in classFactory from .bccscbar import bccScBar
  File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in
_import mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/roxo/.qgis2/python/plugins/bccscbar/bccscbar.py", line
34, in from cdlgSCBR import cdlgSCBR
  File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in
_import mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/roxo/.qgis2/python/plugins/bccscbar/cdlgSCBR.py", line
48, in from ui_dialogScaleBar import Ui_Dialog
  File "/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in
_import mod = _builtin_import(name, globals, locals, fromlist, level)
  File
"/home/roxo/.qgis2/python/plugins/bccscbar/ui_dialogScaleBar.py", line
227, in import resources_rc File
"/usr/lib/python2.7/dist-packages/qgis/utils.py", line 572, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named resources_rc


Python version: 2.7.6 (default, Jun 22 2015, 18:01:27) [GCC 4.8.2]
QGIS version: 2.12.0-Lyon Lyon, exported
=================8<--------------------------

  Am I missing something here?

  Regards.


> 
> You can then use the logic in your command line version... 
> 
> Regards,
> Benoit 
> 
> ---
> Benoit de Cabissole, Ph.D.
> BC Consulting
> benoit-3 at bc-consult.com
> Mobile: +27 84 435 9868
> Tel: +27 11 794 6064
> 
> On 03/11/2015 23:59, Robin Wilson wrote: 
> 
> > Hi, 
> > 
> > I do a lot of visualisation of raster layers using the pseudo-color
> > symbology, but I don't like how the legends are produced: they just
> > show the individual colors for each of the specific values you've
> > selected in the symbology dialog box (see
> > https://www.dropbox.com/s/29yhsofvnrp8ey7/QGISLegend.png?dl=0 [2]). 
> > 
> > I've been using the Color Scale Bar for One-Band Rasters plugin
> > available at http://www.bc-consult.com/free/bccscbar.html [3] for a
> > while now - albeit in a version that I've modified to run from the
> > command-line. This produces nice 'colorbar-style' legends like
> > this:
> > https://www.dropbox.com/s/2lsh7wx1ygzykuy/QGISLegend_Colorbar.png?dl=0
> > [4], but it takes a bit of work (you have to export the color ramp
> > used, and then run this command to load in the file and produce the
> > color bar). 
> > 
> > I'm keen to work to integrate this further into QGIS. Is this
> > something which would be encouraged? 
> > 
> > I can see a number of different levels of integration: 
> > 
> > 1. A plugin that works in a similar way to the current plugin - but
> > that allows you to select a layer directly, and skip the stage of
> > having to save the color ramp out to a file. This should be fairly
> > easy, and just requires finding a way to grab the data that would
> > be saved out to file through the QGIS API. Can anyone point me in
> > the right direction? 
> > 
> > 2. A plugin to the Print Composer (can this be done?) which creates
> > a new 'composer object' which will automatically contain a nice
> > colorbar for the specified layer. 
> > 
> > 3. A new feature for QGIS itself to allow legends for pseudo-color
> > rasters to be either the current style, or this 'colorbar' style.
> > This would be the hardest to do, and I'm not entirely sure whether
> > my programming skills are up to it (I gather the majority of QGIS
> > is written in C++). 
> > 
> > Any thoughts on the idea itself, or any of these potential levels
> > of integration? 
> > 
> > Best regards, 
> > 
> > Robin 
> > 
> > _______________________________________________
> > Qgis-user mailing list
> > Qgis-user at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-user [1]
>  
> 
> Links:
> ------
> [1] http://lists.osgeo.org/mailman/listinfo/qgis-user
> [2] https://www.dropbox.com/s/29yhsofvnrp8ey7/QGISLegend.png?dl=0
> [3] http://www.bc-consult.com/free/bccscbar.html
> [4]
> https://www.dropbox.com/s/2lsh7wx1ygzykuy/QGISLegend_Colorbar.png?dl=0








  Roxo

-- 
---------------- Non luctari, ludare -------------------+ WYSIWYG
Fernando M. Roxo da Motta <petro at roxo.org>              | Editor?
Except where explicitly stated I speak on my own behalf.|  VI !!
      ( Usuário Linux registrado #39505 )               | I see text,
------------ Quis custodiet ipsos custodes?-------------+ I get text!
 



More information about the Qgis-user mailing list