[Qgis-developer] Enchancing New Symbology - ColorRamp Edit

Benoit de Cabissole benoit at exigesa.com
Sun Aug 22 08:17:01 EDT 2010


Hi Giovanni,

> I agree that our best chance is actually supporting/helping Benoit
> developing his plugin. Ideally at some stage it could be added to core
> as it was done for the Martin labelling plugin.
>
> Benoit, any enhancement on sight regarding the speed needed to read
> the rasters (with your plugin)?
>
> See also
>
> https://trac.osgeo.org/qgis/ticket/782


Regarding the loading speed problem, well, no answer as yet...
Another solution would be to only compute the stats of the raster and not
display a thumbnail of the raster in the plugin but to work directly in the
main window. Problem with that is that the raster must be on top of the
stack in order to be visible: not really a good solution!
Another way would be to create a batch file to generate the ".bccpal" files
from the user rasters that will run when user is not busy. The .bccpal files
are thumbnail files generated when user creates the first colour table and
are re-used the next time the user launch the plugin on the same raster file
(on condition that the user doesn't delete those file the loading speed is
dramatically increased!).
A third way would be to write a C++ routine to speed up that part of the
algorithm. It is not the reading of the data from disk but rather the
algorithm I'm using to generate the thumbnail raster and generate the stats
(histogram) that slows down processing. Note that in VB6 it is much much
faster than in python, so yes the language it is written in will make a
difference (unfortunately C++/C are Martian-speak to me!).



> a very neat feature would be the possibility to import color
> ramps, for example
>
> http://soliton.vm.bytemark.co.uk/pub/cpt-city/grass/index.html
>

Regarding importing colour ramps: you could have noticed that some of the
ramps presented at the above reference have already been converted to colour
palettes for use in the plugin!
The colouring algorithm I'm using needs to deal with discrete colour values
and not with abstract ones as used by GRASS, GMT, and others. The way around
it that I've used was to import an image of a colour ramp into an imagebox
and sample each pixel for its colour to create a "discrete" colour palette
used by the plugin. In fact most of the colour palettes provided with the
plugin have been generated in this way! (Again this little app is VB6 based,
and could be converted to python if there is an interest).
So, yes, there is a way to import a colour ramp, provided there is an image
of it.

Also note that in its present stage the python plugin cannot be used to set
a real-life value to a given colour. Real-life values are given to a colour
in function of the colouring method used and the histogram of the data. So
ramps like 'corine' or 'srtm' from the above reference will be difficult to
use with the plugin.

Cheers,
Benoit



> cheers
>
> -- Giovanni --
>
>
> On Sun, Aug 22, 2010 at 8:09 AM, Benoit EXIGE <benoit at exigesa.com> wrote:
> > Hi Noli,
> >
> > Did you have a look at the 1-band raster colour plugin?
> > I've posted it in the QGIS repository. It is flagged as
> experimental so you
> > will have to enable experimental plugin in the plugin manager.
> > I think it will respond to what you are looking for.
> >
> > Cheers,
> > Benoit
> >
> >
> > On 22 Aug 2010, at 3:24, Noli Sicad <nsicad at gmail.com> wrote:
> >
> >> Hi,
> >>
> >> It seems that QGIS has only 3 color ramps, probably we can improve it
> >> by adding more options and increase the class size as well.
> >>
> >> http://www.qgis.org/wiki/Symbology_RFC#Python_plugin
> >> Where is the "Color ramp dialogs"? Is this implemented?
> >>
> >> I find color ramps in R package quite flexible especially using ssplot
> >> for thematic mapping. Color Brewer is quite limited.
> >>
> >> ColorRamps
> >>
> >>
> http://bm2.genes.nig.ac.jp/RGM2/R_current/library/IDPmisc/man/IDPc
olorRamp.html
>>
>> http://cran.r-project.org/web/packages/colorRamps/colorRamps.pdf
>>
>> Now, how can we hack QGIS 1.5 to add more color ramps pallete
>>
>>
>>
http://bm2.genes.nig.ac.jp/RGM2/R_current/library/IDPmisc/man/IDPcolorRamp.h
tml
>>
>> Arcgis is also using color ramps.
>>
>> ArcMap Edit color ramp
>> http://www.tectonics.caltech.edu/gis/reference/color_ramp.html
>>
>> Noli
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



More information about the Qgis-developer mailing list