[Qgis-developer] Re: classification of rasters

Peter Ersts ersts at amnh.org
Sat Mar 17 19:44:03 EDT 2007


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
>
>   


-- 
====================================
Peter J. Ersts, Project Specialist
American Museum of Natural History
Center for Biodiversity and Conservation
Central Park West at 79th Street
New York, New York 10024
Tel: (212)-496-3488 or (212)-769-5742
Fax: (212)-313-7295 or (212)-769-5292
Web: http://cbc.amnh.org

Visit the Indo-South Atlantic Consortium on Humpback Whales 
Web:  http://www.isach.org




More information about the Qgis-developer mailing list