[Qgis-user] Symbolizing a discrete or a boolean raster

Stéphane Henriod s at henriod.info
Mon Jan 9 09:07:36 PST 2017


Hi

thanks for following up!

It actually does part of the job!

Using *Color interpretation: Exact*, I can indeed input the exact values I
want to display (1,5 and 10) and all other pixels are hidden.

HOWEVER,

this still feels like a workaround:

   - In the case of a discrete raster with many (> 50) unique values, I do
   not want to input all of them manually
   - In some cases, I do not know in advance all the unique values of my
   raster
   - If I click on *Classify*, QGIS will choose X values (based on the
   number of classes and the classification method (continuous or equal
   interval)), which no longer match the "exact" values of my raster. It
   doesn't really make sense to classify a discrete rendering

So I would say, we still need a render type "discrete raster" which offers
the function to "retrieve all unique values" (and automatically apply a
discrete color ramp)

Attached a (fake) test dataset.

Thanks and cheers

Stéphane


Le lundi 9 janvier 2017, Enrico Fiore <enricofiore at libero.it> a écrit :

> Hi,
> Sorry I can't do test, but if you use exact in color interpolation
> parameter?
>
> Cheers
>
> Enrico


Le lundi 9 janvier 2017, Stéphane Henriod <s at henriod.info> a écrit :

> Hi
>
> unfortunately this is doing quite something different!
>
> If I have a raster with 10 Landcover classes (1,2,3,4,5,6,7,8,9,10) and I
> want to display only 1,5 and 10, using *Discrete *(1: red, 5: yellow, 10:
> blue) the following will happen:
>
> All pixels between 1 and 4 will be red
> All pixels between 5 and 9 will be yellow
> All pixels with 10 will be blue
>
> In this sense, the pixels are indeed not interpolated, but this still is
> not the behavior I am expecting when styling discrete rasters.
>
> A "style discrete raster" function should offer the following:
>
>    - Automatically recover all unique values from the raster
>    - Only display the pixels to which the user has explicitly assigned a
>    color
>
> But thanks for your hint, this can be helpful in other cases!
>
> Cheers
>
> Stéphane
>
>
> Le lundi 9 janvier 2017, Enrico Fiore <enricofiore at libero.it
> <javascript:_e(%7B%7D,'cvml','enricofiore at libero.it');>> a écrit :
>
>> Hi,
>> I think that the solution is in the QGIS documentation, that you can read
>> here: http://docs.qgis.org/2.14/en/docs/user_manual/working_with_r
>> aster/raster_properties.html#band-rendering
>> you have to use *Singleband pseudocolor *and set color interpolation to
>> Discrete.
>>
>> Enrico
>>
>>
>> ----Messaggio originale----
>> Da: "Stéphane Henriod" <s at henriod.info>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<qgis-user at lists.osgeo.org>
>> Ogg: [Qgis-user] Symbolizing a discrete or a boolean raster
>>
>> Dear all
>>
>> As much as I love QGIS and use it in my everyday life, there is one
>> feature that I find particularly annoying: the styling of discrete rasters.
>>
>> Basically, if I have a raster layer consisting of discrete landcover
>> values (1: water, 2: forest, 3: built-up), it seems that there is no easy
>> way to style it. QGIS will assume that the data is continuous and basically
>> interpolate the color between each value, which leads to the following
>> issues:
>>
>> Let's say I want to display only water and built-up (values 1 and 3),
>> water in blue and built-up in grey. QGIS will still display the forests,
>> using a color somewhere "between" blue and grey. My only left option is to
>> process the raster to actually replace all the 2 with NoData, which is
>> highly unpractical...
>>
>> Same if I have a boolean raster (only 0 and 1 values). QGIS will by
>> default make a color ramp from 0 to 0.9999.
>>
>> Also, the whole rather feels like a work-around for a missing feature.
>>
>> I dream of a feature similar to this one from ArcGIS:
>> http://resources.arcgis.com/en/help/main/10.1/index.
>> html#/representing_unique_categories_such_as_land_use/009t00000074000000/
>> where all unique values are styled independently and where I can easily
>> skip the values I don't want to see on my map.
>>
>> I asked a question here:
>> http://gis.stackexchange.com/questions/194116/qgis-style-a-d
>> iscrete-raster
>>
>> and opened a ticket here:
>> http://hub.qgis.org/issues/14845
>>
>> But none has gotten lots of attention yet... Am I the only one to be
>> annoyed by this? If no, please raise your hand and let's try to get some
>> momentum and see how to push this feature forward!
>>
>> Thanks a lot in advance!
>>
>> Cheers
>>
>> Stéphane
>>
>>
>

-- 
Stéphane Henriod
CIM-Expert for GIS and Green Economy Statistics

Национальный статистический комитет Кыргызской Республики
Кыргыз Республикасынын Улуттук статистика комитети
National Statistical Committee of the Kyrgyz Republic

374 Фрунзе ул. / Frunze str.
720033 Бишкек / Bishkek

T   +996 778 46 99 02 (KG)
T   +49 176 280 11 050 (DE)
E    s at henriod.info
W   http://www.stat.kg
W3W: nightfall.into.bucket
<https://map.what3words.com/nightfall.into.bucket>  //  запас.союз.дружный
<https://map.what3words.com/запас.союз.дружный>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170109/985fd14c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: landcover.zip
Type: application/zip
Size: 2151 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170109/985fd14c/attachment.zip>


More information about the Qgis-user mailing list