[Qgis-developer] Re: classification of rasters

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Mon Mar 19 06:31:57 EDT 2007


Hi Peter,

You are right,  mValueClassification.size() should be replaced with 
mCustomClassificationEnabled. My original idea was that it is either 
clipping/stretching or custom colormap.

> But I maintain the custom color map should display stretch values.

I'm not sure I undestand what you mean. Do you mean that, if there is 
stretching enabled and custom colormap, there should be a combination of 
both?
Maybe I can understand better with an example. Let's say we have a DTM and 
there is clipping and stretching enabled for values 500 - 800. But in custom 
colormap tab there are items 400 red / 600 green / 1000 blue and linear color 
interpolation. How would the application behave in such a situation?

cheers,
Marco



Am Sonntag, 18. März 2007 00:44 schrieb Peter Ersts:
> Howdy Marco and Tim,
>
> Sorry for my lack of input on this I have been a bit neglectful of the
> raster transparency branch over the last week.  I took a look at the
> custom color map changes. They look nice. I made a couple of
> modifications to the ui behavior. The custom color mapping should be
> available for any single band - pseudo color option.
>
> It looks like the custom color map changes will respect the transparency
> setting but it does not play nicely with the stretching.  I made a note
> of this in the latest revision (r6812). When you get a moment please
> check out line 1666 in qgsrasterlayer.cpp.
>
> The custom color map should work with either an unstretched for
> stretched layer. The current logic in drawSingleBandPseudoColor lets the
> custom color map override the stretching, by checking:
>
> if(mValueClassification.size() == 0 && QgsRasterLayer::NO_STRETCH !=
> getColorScalingAlgorithm())
>
> which is fine on the first pass. However, if you create a color map,
> then  disable it, mValueClassification.size() is not reset so stretching
> will never be able to happen again. If it is going to be either a custom
> color map or stretching then the test should be:
>
> if(mCustomClassificationEnabled && QgsRasterLayer::NO_STRETCH !=
> getColorScalingAlgorithm())
>
> But I maintain the custom color map should display stretch values.
>
> Great, well we are making progress but still lots to do!
>
> -pete
>
> Marco Hugentobler wrote:
> > Hi Tim
> >
> > I think it already respects the transparendy settings (at least in the
> > simple test I made).
> >
> > I'm going to a conference this week and will continue hacking raster
> > branch after that.
> >
> > Regards,
> > Marco
> >
> > Am Sonntag, 11. März 2007 05:39 schrieben Sie:
> >> Hi Marco
> >>
> >> I built your changes  and played around with the stuff in the new tab
> >> - looks cool! I would say yes we should disable it unless pseudocolour
> >> is active (since that caveat caught me out already until I came back
> >> and re-read your email :-)
> >>
> >> Will you make it respect the transparency settings that Peter is
> >> implementing? Nice work!
> >>
> >> Regards
> >>
> >> Tim
> >>
> >> 2007/3/10, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch>:
> >>> Hi Tim,
> >>>
> >>> I commited a first attempt for raster classification to the
> >>> transparency branch. The colormap entries are stored in
> >>> QgsRasterLayer::mValueClassification and are drawn in
> >>> QgsRasterLayer::drawSingleBandPseudoColor.
> >>>
> >>> There is a new tab 'colormap' in the raster properties dialog now.
> >>> Custom classification currently only kicks in if pseudo color mode is
> >>> active. Should the colormap dialog be disabled if this is not the 
> >>> case?
> >>>
> >>> Regards,
> >>> Marco
> >>>
> >>> Am Samstag, 10. März 2007 11:44 schrieb Tim Sutton:
> >>>> Hi Marco
> >>>>
> >>>> Sounds cool! I'm also in favour of a new tab since I dont like lots of
> >>>> pop up windows ala arcmap.
> >>>>
> >>>> Regards
> >>>>
> >>>> Tim
> >>>>
> >>>> 2007/3/10, Marco Hugentobler <marco.hugentobler at karto.baug.ethz.ch>:
> >>>>> Hi Tim,
> >>>>>
> >>>>> I did some experiments with classifications by evaluating value
> >>>>> against a set of classes. It slows down rendering a bit, but speed
> >>>>> seems still acceptable for a first version. I may return and try to
> >>>>> enhance speed with color tables later.
> >>>>>
> >>>>> I'm trying to program a GUI for the classification now. I see two
> >>>>> possibilities:
> >>>>>
> >>>>> A new tab called 'custom color map' in the raster layer properties,
> >>>>> containing the GUI elements to create a classification.
> >>>>>
> >>>>> A button 'custom color map...' under the color map combo box. This
> >>>>> would pop up the dialog for creating the classification.
> >>>>>
> >>>>> I'm more in favour of the first one, as it allows users to immediatly
> >>>>> try out the symbology by pressing 'apply'. What do you think?
> >>>>>
> >>>>>
> >>>>> Regards,
> >>>>> Marco
> >>
> >> --
> >
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.qgis.org
> > http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer



More information about the Qgis-developer mailing list