[Qgis-developer] color ramps for vector graduated symbols (ticket #782)

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Thu Nov 8 04:10:31 EST 2007


Hi Matthew,

I had a look at the color ramps patch and in my opinion, this is a really cool 
and useful enhancement.

Some suggestions:
- As you already wrote, it would be good to parse the directory and have a 
dropdown list
- It would be more Qt style (and probably more platform independent) to use 
the QTextStream class instead of C i/o methods
- It seems to me that these .cpt files already define the number of steps and 
the class boundaries. Maybe it would be an option to have a button 'from 
color ramp...' in the graduated symbol dialog that opens a dialog where the 
available ranges are visualised. Then, after selecting and clicking ok, the 
classes, number of classes and their boundaries are directly inserted into 
the list. The same dialog could also be used for the continuous renderer 
(where the interpretation of the ramps would be continuous) so the ramps 
could be stored in one directore. What do you think?



Regards,
Marco



On Thursday 25 October 2007 22:21:07 you wrote:
> Marco,
>
>   Thanks for taking an interest in it.I've been doing a bit more
> research into it and I think that .cpt color ramps are the way to go.
> They are widely supported by GMT and can describe both continuous and
> discrete ramps. The format is 8 columns, tab delimited describing:
>
> begin_value red green blue end_value red green blue
>
> so this can easily be made into a discrete ramp by making the beginng
> and ending rgb equal. There are alot of .cpt ramps available from
> http://sview01.wiredworkplace.net/pub/cpt-city/
>
> I've begun a to write some code to parse cpt ramps and interpolate
> colors based on input values. It works but only for graduated symbols
> and there are alot of hardcoded paths and no UI. It is very clunky at
> the moment but I hope to clean it up and post a patch this weekend.
>
> I think your suggestion of having a color ramp directory in share/qgis
> is perfect. Files available from this dir could populate a dropdown
> list in the graduatedsymbol ui and the color could be loaded from the
> file on demand.
>
>
> I'll keep you posted.
>
> - matt
>
> On 10/25/07, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch> wrote:
> > Hi Perrygeo,
> >
> > A flexible solution for color ramps as you describe it in ticket 782
> > would be a really great enhancement for qgis.
> >
> > >The remaining questions are:
> > > - what file format works to define the color ramps? have to allow for
> > > all 4 of the above types. As much as possible, leverage existing
> > > formats like gmt and grass color ramps.
> > >
> >  >- how do the ramps get "registered" with qgis so that they can be made
> > >
> > >available to the user?
> > >- how do they get integrated with the UI? preferably a dropdown list of
> > > color ramps with a small representative image of the ramp itself.
> > > - how to we implement the algorithm to determine the rgb color for
> > > ramps of type #1 and #2?
> >
> > Registered ramps could be stored in a dedicated directory under
> > share/qgis, similar to the way it is done with the svg markers.
> >
> > Hopefully you can find a good storage format for the ramps. If there is
> > no format that meets all your requirements, you could still design your
> > own xml based language  (crml = color ramp markup language)
> >
> > Regards,
> > Marco
> >
> >
> >
> >
> > --
> > Dr. Marco Hugentobler
> > Institute of Cartography
> > ETH Zurich
> > Technical Advisor QGIS Project Steering Committee
> > marco.hugentobler at karto.baug.ethz.ch



-- 
Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
Technical Advisor QGIS Project Steering Committee
marco.hugentobler at karto.baug.ethz.ch



More information about the Qgis-developer mailing list