Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Chris House
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email]> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email]

You can reach the person managing the list at
        [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]>
>> 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    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user-request@lists.osgeo.org&#39;);" target="_blank">qgis-user-request@lists.osgeo.org> wrote:
Send Qgis-user mailing list submissions to
        <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user@lists.osgeo.org&#39;);" target="_blank">qgis-user@...

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user-request@lists.osgeo.org&#39;);" target="_blank">qgis-user-request@....org

You can reach the person managing the list at
        <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user-owner@lists.osgeo.org&#39;);" target="_blank">qgis-user-owner@...g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>
To: Enrico Fiore <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...>
Cc: qgis-user <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user@lists.osgeo.org&#39;);" target="_blank">qgis-user@...>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;CAK6pVBXURm_e7dRP%2B8SP9amPUUX0%2BCn3GVxLPNjOHhno85o2rA@mail.gmail.com&#39;);" target="_blank">CAK6pVBXURm_e7dRP+8SP9amPUUX0+Cn3GVxLPNjOHhno85o2rA@...ail.com>
Content-Type: text/plain; charset="utf-8"

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 <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...> 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 <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...> 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 <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...
> <javascript:_e(%7B%7D,'cvml','<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...');>> 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" <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user@lists.osgeo.org&#39;);" target="_blank">qgis-user@...geo.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    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Qgis-user@lists.osgeo.org&#39;);" target="_blank">Qgis-user@...
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

DelazJ
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
Done, I moved it to the developer list: https://lists.osgeo.org/pipermail/qgis-developer/2017-January/046547.html

Thanks for the hint!

Cheers

Stéphane

Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>:
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;housec01@gmail.com&#39;);" target="_blank">housec01@...> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...


_______________________________________________
Qgis-user mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Qgis-user@lists.osgeo.org&#39;);" target="_blank">Qgis-user@...
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Richard McDonnell
In reply to this post by DelazJ
Harrissou,

Not sure if this is a solution, or if anyone has already given you this answer, but.... if you know a classified raster has 50 values, which you wish to style individually, you could try setting:
  • Colour Interpolation to Linear
  • Mode to Equal Interval
  • Classes to 51 (one more than the Max)

I have only just tested this on a raster with 4 values and its worked for me!
Hope this helps!

Regards,

Richard.

On 10/01/2017 09:49, DelazJ wrote:
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <<a class="moz-txt-link-freetext" href="javascript:_e(%7B%7D,'cvml">javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a moz-do-not-send="true" href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a moz-do-not-send="true" href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

--
Richard McDonnell
GIS Specialist PgD GIS AssocSCSI
OPW FRM Data Management
52 Stephens Green, Dublin 2.
TEL: 01 6476543


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
In reply to this post by DelazJ
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>:
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;housec01@gmail.com&#39;);" target="_blank">housec01@...> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...


_______________________________________________
Qgis-user mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Qgis-user@lists.osgeo.org&#39;);" target="_blank">Qgis-user@...
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
In reply to this post by Richard McDonnell
Hi Richard

this is a nice workaround, that I will also probably use in the future! Thanks a lot!

However, this becomes unhandy:
  • if the raster doesn't contain all values between 1 and 50 (let's say, there are only classes 2, 23, 56 and 49) => need to manually remove all the unnecessary values
  • if the raster contains a discrete amount of decimal values (2.3, 4.5 and 12.8)
  • if I don't know in advance the number of classes (which happens quite often: I receive a dataset that I don't know much about and want to quickly display / style it to explore it)
All the answers in this thread actually justify (IMO) the feature request: it is at the moment possible to style discrete rasters in QGIS but only using workarounds that are not necessarily adapted in all cases and that are completely untransparent for beginners.

All the best

Stéphane


Le mardi 10 janvier 2017, Richard McDonnell <[hidden email]> a écrit :
Harrissou,

Not sure if this is a solution, or if anyone has already given you this answer, but.... if you know a classified raster has 50 values, which you wish to style individually, you could try setting:
  • Colour Interpolation to Linear
  • Mode to Equal Interval
  • Classes to 51 (one more than the Max)

I have only just tested this on a raster with 4 values and its worked for me!
Hope this helps!

Regards,

Richard.

On 10/01/2017 09:49, DelazJ wrote:
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>:
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;housec01@gmail.com&#39;);" target="_blank"><a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;housec01@gmail.com&#39;);" target="_blank">housec01@...> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user-request@lists.osgeo&#39;);" target="_blank">qgis-user-request@....org> wrote:
Send Qgis-user mailing list submissions to
        <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user@lists.osgeo.org&#39;);" target="_blank">qgis-user@...

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user-request@lists.osgeo&#39;);" target="_blank">qgis-user-request@....org

You can reach the person managing the list at
        <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user-owner@lists.osgeo.or&#39;);" target="_blank">qgis-user-owner@...g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>
To: Enrico Fiore <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...>
Cc: qgis-user <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user@lists.osgeo.org&#39;);" target="_blank">qgis-user@...>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...> 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 <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...> 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 <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...
> <javascript:_e(%7B%7D,'cvml','<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;enricofiore@libero.it&#39;);" target="_blank">enricofiore@...');>> 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" <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;qgis-user@lists.os&#39;);" target="_blank">qgis-user@...geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...


_______________________________________________
Qgis-user mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Qgis-user@lists.osgeo.org&#39;);" target="_blank">Qgis-user@...
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



_______________________________________________
Qgis-user mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Qgis-user@lists.osgeo.org&#39;);" target="_blank">Qgis-user@...
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

--
Richard McDonnell
GIS Specialist PgD GIS AssocSCSI
OPW FRM Data Management
52 Stephens Green, Dublin 2.
TEL: 01 6476543



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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Pedro Monteiro
I totally agree. For a simple user like me, directly retrieving unique values (like ArcGis does), and having direct access to raster tables, would be a major step to enhance raster work productivity.

All the best

Pedro Monteiro



       



  




2017-01-11 3:55 GMT+00:00 Stéphane Henriod <[hidden email]>:
Hi Richard

this is a nice workaround, that I will also probably use in the future! Thanks a lot!

However, this becomes unhandy:
  • if the raster doesn't contain all values between 1 and 50 (let's say, there are only classes 2, 23, 56 and 49) => need to manually remove all the unnecessary values
  • if the raster contains a discrete amount of decimal values (2.3, 4.5 and 12.8)
  • if I don't know in advance the number of classes (which happens quite often: I receive a dataset that I don't know much about and want to quickly display / style it to explore it)
All the answers in this thread actually justify (IMO) the feature request: it is at the moment possible to style discrete rasters in QGIS but only using workarounds that are not necessarily adapted in all cases and that are completely untransparent for beginners.

All the best

Stéphane


Le mardi 10 janvier 2017, Richard McDonnell <[hidden email]> a écrit :
Harrissou,

Not sure if this is a solution, or if anyone has already given you this answer, but.... if you know a classified raster has 50 values, which you wish to style individually, you could try setting:
  • Colour Interpolation to Linear
  • Mode to Equal Interval
  • Classes to 51 (one more than the Max)

I have only just tested this on a raster with 4 values and its worked for me!
Hope this helps!

Regards,

Richard.

On 10/01/2017 09:49, DelazJ wrote:
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

--
Richard McDonnell
GIS Specialist PgD GIS AssocSCSI
OPW FRM Data Management
52 Stephens Green, Dublin 2.
TEL: 01 6476543



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

DelazJ
In reply to this post by Stéphane Henriod
Hi Stéphane,

I gave it a look and I'm sorry I was wrong. There have been some work on the raster classification but it was rather about color and extent management. See https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20 or https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20 but testing upcoming 3.0 shows that nothing has changed in the area you are interested in.

Harrissou

2017-01-11 4:37 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris

this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)



_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
Thanks for checking, that's what I realized as well!

Do you know if there is still a chance to include it for 3.0 or is it too late already?

Cheers

Stéphane


Le mercredi 11 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

I gave it a look and I'm sorry I was wrong. There have been some work on the raster classification but it was rather about color and extent management. See https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20 or https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20 but testing upcoming 3.0 shows that nothing has changed in the area you are interested in.

Harrissou

2017-01-11 4:37 GMT+01:00 Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...>:
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;delazj@gmail.com&#39;);" target="_blank">delazj@...> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris
this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...





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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Alexandre Neto

I will share my opinion as I did in the developers list.

We users are as responsible for QGIS development as the developers. So rather than asking what QGIS can do for us, maybe we should think what we can do for QGIS. Don't just wait that a volunteer developer decide to spend his free time developing a tool that you need.

IMHO, since it seems that you are not able/willing to sponsor the feature yourself, sounds like a good opportunity for a small crowdfunding.

That way you would be able to contribute back to QGIS by giving your time in finding a developer able to do it, setting up the crowdfunding, advertise it, pay for part of it and so on.

It looks like a simple feature. It should not be very expensive (much less than an ArcGIS license for sure), and if you think many people need this, then the money will be easy to raise. And there is still time to introduce this before QGIS 3.0.

Best regards,
Alexandre Neto


A qua, 11/01/2017, 14:55, Stéphane Henriod <[hidden email]> escreveu:
Thanks for checking, that's what I realized as well!

Do you know if there is still a chance to include it for 3.0 or is it too late already?

Cheers

Stéphane


Le mercredi 11 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

I gave it a look and I'm sorry I was wrong. There have been some work on the raster classification but it was rather about color and extent management. See https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20 or https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20 but testing upcoming 3.0 shows that nothing has changed in the area you are interested in.

Harrissou

2017-01-11 4:37 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris
this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email]> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email]

You can reach the person managing the list at
        [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <[hidden email]>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]>
>> 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   <a href="tel:+49%20176%2028011050" value="+4917628011050" class="gmail_msg" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" class="gmail_msg" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" class="gmail_msg" target="_blank">+49 176 280 11 050 (DE)





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

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
--
Alexandre Neto
---------------------
@AlexNetoGeo
http://gisunchained.wordpress.com

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Nyall Dawson
On 12 January 2017 at 04:59, Alexandre Neto <[hidden email]> wrote:

> I will share my opinion as I did in the developers list.
>
> We users are as responsible for QGIS development as the developers. So
> rather than asking what QGIS can do for us, maybe we should think what we
> can do for QGIS. Don't just wait that a volunteer developer decide to spend
> his free time developing a tool that you need.
>
> IMHO, since it seems that you are not able/willing to sponsor the feature
> yourself, sounds like a good opportunity for a small crowdfunding.
>
> That way you would be able to contribute back to QGIS by giving your time in
> finding a developer able to do it, setting up the crowdfunding, advertise
> it, pay for part of it and so on.
>
> It looks like a simple feature. It should not be very expensive (much less
> than an ArcGIS license for sure), and if you think many people need this,
> then the money will be easy to raise. And there is still time to introduce
> this before QGIS 3.0.

Just to add to this - you may find the writeup at
http://nyalldawson.net/2016/08/how-to-effectively-get-things-changed-in-qgis/
useful as a summary of the different approaches you can take to get
this feature implemented.

What you've done so far is a perfect first step - determining that
there's high demand and lots of interest in your feature!

Nyall



>
> Best regards,
> Alexandre Neto
>
>
> A qua, 11/01/2017, 14:55, Stéphane Henriod <[hidden email]> escreveu:
>>
>> Thanks for checking, that's what I realized as well!
>>
>> Do you know if there is still a chance to include it for 3.0 or is it too
>> late already?
>>
>> Cheers
>>
>> Stéphane
>>
>>
>> Le mercredi 11 janvier 2017, DelazJ <[hidden email]> a écrit :
>>>
>>> Hi Stéphane,
>>>
>>> I gave it a look and I'm sorry I was wrong. There have been some work on
>>> the raster classification but it was rather about color and extent
>>> management. See
>>> https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20
>>> or
>>> https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20
>>> but testing upcoming 3.0 shows that nothing has changed in the area you are
>>> interested in.
>>>
>>> Harrissou
>>>
>>> 2017-01-11 4:37 GMT+01:00 Stéphane Henriod <[hidden email]>:
>>>>
>>>> Hi Harrissou
>>>>
>>>> is there any description / documentation of the work that has been done
>>>> on this (feature description, etc.)? If yes, I'd like to have a look and
>>>> maybe
>>>>
>>>> Thanks a lot!
>>>>
>>>> Stéphane
>>>>
>>>>
>>>> Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
>>>>>
>>>>> Hi Stéphane,
>>>>>
>>>>> 2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
>>>>>>
>>>>>> Hi Chris
>>>>>> this is very nice! I indeed didn't know this trick and will certainly
>>>>>> use it again in the future!
>>>>>>
>>>>>> However... :-)
>>>>>>
>>>>>> I am currently teaching QGIS to beginners and this for sure is not an
>>>>>> appropriate method for them (especially in the case you have to generate the
>>>>>> symbology file through a script)!
>>>>>>
>>>>>> Since the user can style continuous rasters with some
>>>>>> "button-clicking", I believe the same option should be available for
>>>>>> discrete rasters as well.
>>>>>>
>>>>>> I am thus wondering if anyone else than me sees it as a priority for
>>>>>> QGIS? If yes, how to motivate the developers to take it for the next release
>>>>>> and / or how much would such a development cost? (I unfortunately don't have
>>>>>> the competences to do it myself)
>>>>>>
>>>>> There have been some work done in the raster properties dialog in the
>>>>> upcoming 3.0. I don't know if your concern was covered though.
>>>>> If you want, you can move the question to the developer's list and
>>>>> discuss whether/how this can be implemented (and its requirements).
>>>>>
>>>>> Regards,
>>>>> Harrissou
>>>>>
>>>>>> Thanks again and cheers!
>>>>>>
>>>>>> Stéphane
>>>>>>
>>>>>>
>>>>>> Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
>>>>>>>
>>>>>>> Hi Stéphane,
>>>>>>>
>>>>>>> I don't know if this is what you are looking for or not but I have a
>>>>>>> method of classifying rasters by color based on a set (standard) colors.  I
>>>>>>> created a spreadsheet that has several required columns, value, red, green,
>>>>>>> blue...and you can have an optional field for a display value.  So say value
>>>>>>> 1 is water you can use that last column to name that value so that in the
>>>>>>> QGIS layer tree and in legend it says Water instead of value 1.
>>>>>>>
>>>>>>> save the spreadsheet as a csv and change the extension to .txt
>>>>>>> instead of .csv.
>>>>>>>
>>>>>>> I then go into the symbology section of the raster choose singleband
>>>>>>> pseudocolor. Use the folder to browse to your text file and click add.
>>>>>>> There is a format for this text file.  It is below.  If you need me to email
>>>>>>> it I will do that in direct email.
>>>>>>>
>>>>>>> # QGIS Generated Color Map Export File
>>>>>>> INTERPOLATION:EXACT
>>>>>>> -9999,0,0,0,255,NoData
>>>>>>> 0,176,176,176,255,Non-Forested
>>>>>>> 15,234,255,191,255,10 <=  CC < 20
>>>>>>> 25,187,230,149,255,20 <=  CC < 30
>>>>>>> 35,140,201,109,255,30 <=  CC < 40
>>>>>>> 45,98,176,74,255,40 <=  CC < 50
>>>>>>> 55,59,153,43,255,50 <= CC < 60
>>>>>>> 65,0,128,0,255,60 <=  CC < 70
>>>>>>> 75,15,92,11,255,70 <=  CC < 80
>>>>>>> 85,17,61,12,255,80 <=  CC < 90
>>>>>>> 95,16,36,12,255,90 <=  CC <= 100
>>>>>>>
>>>>>>> In my example if I don't assign a value it gets ignored by QGIS.  If
>>>>>>> you are wondering how to assign unique colors to say 200 unique
>>>>>>> values...just script it.  I have done this and as long as you have the
>>>>>>> number of unique values you want and to make them unique in the script it
>>>>>>> works.
>>>>>>>
>>>>>>> I hope this helps.  I know it isn't a "button" but to be honest I
>>>>>>> like this better.  If you already knew this...well then maybe it will help
>>>>>>> someone out in the future.
>>>>>>>
>>>>>>> --Chris
>>>>>>>
>>>>>>> On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email]>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> Send Qgis-user mailing list submissions to
>>>>>>>>         [hidden email]
>>>>>>>>
>>>>>>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>>>>>>         http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>> or, via email, send a message with subject or body 'help' to
>>>>>>>>         [hidden email]
>>>>>>>>
>>>>>>>> You can reach the person managing the list at
>>>>>>>>         [hidden email]
>>>>>>>>
>>>>>>>> When replying, please edit your Subject line so it is more specific
>>>>>>>> than "Re: Contents of Qgis-user digest..."
>>>>>>>>
>>>>>>>>
>>>>>>>> Today's Topics:
>>>>>>>>
>>>>>>>>    1. Re: Symbolizing a discrete or a boolean raster (Stéphane
>>>>>>>> Henriod)
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ----------------------------------------------------------------------
>>>>>>>>
>>>>>>>> Message: 1
>>>>>>>> Date: Mon, 9 Jan 2017 23:07:36 +0600
>>>>>>>> From: Stéphane Henriod <[hidden email]>
>>>>>>>> To: Enrico Fiore <[hidden email]>
>>>>>>>> Cc: qgis-user <[hidden email]>
>>>>>>>> Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
>>>>>>>> Message-ID:
>>>>>>>>
>>>>>>>> <[hidden email]>
>>>>>>>> Content-Type: text/plain; charset="utf-8"
>>>>>>>>
>>>>>>>> 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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
>>>>>>>> > <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>>>>>>>> >> Data: 09/01/2017 6.30
>>>>>>>> >> A: "qgis-user"<[hidden email]>
>>>>>>>> >> 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    [hidden email]
>>>>>>>> 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-0001.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-0001.zip>
>>>>>>>>
>>>>>>>> ------------------------------
>>>>>>>>
>>>>>>>> Subject: Digest Footer
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Qgis-user mailing list
>>>>>>>> [hidden email]
>>>>>>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>>>>
>>>>>>>> ------------------------------
>>>>>>>>
>>>>>>>> End of Qgis-user Digest, Vol 131, Issue 13
>>>>>>>> ******************************************
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> 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    [hidden email]
>>>>>> W   http://www.stat.kg
>>>>>> W3W: nightfall.into.bucket  //  запас.союз.дружный
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> Qgis-user mailing list
>>>>>> [hidden email]
>>>>>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> 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    [hidden email]
>>>> W   http://www.stat.kg
>>>> W3W: nightfall.into.bucket  //  запас.союз.дружный
>>>>
>>>>
>>>
>>
>>
>> --
>> 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    [hidden email]
>> W   http://www.stat.kg
>> W3W: nightfall.into.bucket  //  запас.союз.дружный
>>
>> _______________________________________________
>> Qgis-user mailing list
>> [hidden email]
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
>
> --
> Alexandre Neto
> ---------------------
> @AlexNetoGeo
> http://sigsemgrilhetas.wordpress.com
> http://gisunchained.wordpress.com
>
> _______________________________________________
> Qgis-user mailing list
> [hidden email]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
In reply to this post by Alexandre Neto
Hi Alexandre

(also posting on dev-)

I 100% agree with you and I would love to somehow give back to QGIS (I did already, but at a small scale).

I mostly wanted to know if I am the only one to wish for this feature. Apparently not the case: many have expressed the same wish!

Now funding: I would love to have a rough idea what "not very expensive" means. If there are any dev around who could have the interest / skills to implement this feature, can we somehow go concrete and work together on a feature description and tentative budget? The situation is obviously very different if we talk about 1.000 or 20.000€

And thanks Nyall for your amazing overview. That indeed makes things much clearer to me!

Cheers

Stéphane


Le jeudi 12 janvier 2017, Alexandre Neto <[hidden email]> a écrit :

I will share my opinion as I did in the developers list.

We users are as responsible for QGIS development as the developers. So rather than asking what QGIS can do for us, maybe we should think what we can do for QGIS. Don't just wait that a volunteer developer decide to spend his free time developing a tool that you need.

IMHO, since it seems that you are not able/willing to sponsor the feature yourself, sounds like a good opportunity for a small crowdfunding.

That way you would be able to contribute back to QGIS by giving your time in finding a developer able to do it, setting up the crowdfunding, advertise it, pay for part of it and so on.

It looks like a simple feature. It should not be very expensive (much less than an ArcGIS license for sure), and if you think many people need this, then the money will be easy to raise. And there is still time to introduce this before QGIS 3.0.

Best regards,
Alexandre Neto


A qua, 11/01/2017, 14:55, Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...> escreveu:
Thanks for checking, that's what I realized as well!

Do you know if there is still a chance to include it for 3.0 or is it too late already?

Cheers

Stéphane


Le mercredi 11 janvier 2017, DelazJ <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;delazj@gmail.com&#39;);" target="_blank">delazj@...> a écrit :
Hi Stéphane,

I gave it a look and I'm sorry I was wrong. There have been some work on the raster classification but it was rather about color and extent management. See https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20 or https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20 but testing upcoming 3.0 shows that nothing has changed in the area you are interested in.

Harrissou

2017-01-11 4:37 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris
this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <qgis-user-request@lists.osgeo.org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email].org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+Cn3GVxLPNjOHhno85o2rA@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<qgis-user@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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)





--
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    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...

_______________________________________________
Qgis-user mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;Qgis-user@lists.osgeo.org&#39;);" target="_blank">Qgis-user@...
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
--
Alexandre Neto
---------------------
@AlexNetoGeo
http://gisunchained.wordpress.com


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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
Hi all

upon advice from Andreas, I started a formal description of the requirements for such a feature:


Please, anyone interested, do check, comment, add, correct,... Once we have a "final" version, I will inquire a more precise financial estimation. Then let's see how we can move forward!

Thanks and cheers

Stéphane

Le jeudi 12 janvier 2017, Stéphane Henriod <[hidden email]> a écrit :
Hi Alexandre

(also posting on dev-)

I 100% agree with you and I would love to somehow give back to QGIS (I did already, but at a small scale).

I mostly wanted to know if I am the only one to wish for this feature. Apparently not the case: many have expressed the same wish!

Now funding: I would love to have a rough idea what "not very expensive" means. If there are any dev around who could have the interest / skills to implement this feature, can we somehow go concrete and work together on a feature description and tentative budget? The situation is obviously very different if we talk about 1.000 or 20.000€

And thanks Nyall for your amazing overview. That indeed makes things much clearer to me!

Cheers

Stéphane


Le jeudi 12 janvier 2017, Alexandre Neto <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;senhor.neto@gmail.com&#39;);" target="_blank">senhor.neto@...> a écrit :

I will share my opinion as I did in the developers list.

We users are as responsible for QGIS development as the developers. So rather than asking what QGIS can do for us, maybe we should think what we can do for QGIS. Don't just wait that a volunteer developer decide to spend his free time developing a tool that you need.

IMHO, since it seems that you are not able/willing to sponsor the feature yourself, sounds like a good opportunity for a small crowdfunding.

That way you would be able to contribute back to QGIS by giving your time in finding a developer able to do it, setting up the crowdfunding, advertise it, pay for part of it and so on.

It looks like a simple feature. It should not be very expensive (much less than an ArcGIS license for sure), and if you think many people need this, then the money will be easy to raise. And there is still time to introduce this before QGIS 3.0.

Best regards,
Alexandre Neto


A qua, 11/01/2017, 14:55, Stéphane Henriod <[hidden email]> escreveu:
Thanks for checking, that's what I realized as well!

Do you know if there is still a chance to include it for 3.0 or is it too late already?

Cheers

Stéphane


Le mercredi 11 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

I gave it a look and I'm sorry I was wrong. There have been some work on the raster classification but it was rather about color and extent management. See https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20 or https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20 but testing upcoming 3.0 shows that nothing has changed in the area you are interested in.

Harrissou

2017-01-11 4:37 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris
this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)





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

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
--
Alexandre Neto
---------------------
@AlexNetoGeo
http://gisunchained.wordpress.com


--
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    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...



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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
Hi all

I have seen that quite a few people had a look at this feature description but only few commented or modified it. Can I assume that most agree with the description as it is and would support / welcome such an implementation?

If no major concern, I would love to ask a quote to a few devs by the end of this week so that we can quickly evaluate the financial options.

Thanks a lot in advance!

Stéphane


Le jeudi 12 janvier 2017, Stéphane Henriod <[hidden email]> a écrit :
Hi all

upon advice from Andreas, I started a formal description of the requirements for such a feature:


Please, anyone interested, do check, comment, add, correct,... Once we have a "final" version, I will inquire a more precise financial estimation. Then let's see how we can move forward!

Thanks and cheers

Stéphane

Le jeudi 12 janvier 2017, Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...> a écrit :
Hi Alexandre

(also posting on dev-)

I 100% agree with you and I would love to somehow give back to QGIS (I did already, but at a small scale).

I mostly wanted to know if I am the only one to wish for this feature. Apparently not the case: many have expressed the same wish!

Now funding: I would love to have a rough idea what "not very expensive" means. If there are any dev around who could have the interest / skills to implement this feature, can we somehow go concrete and work together on a feature description and tentative budget? The situation is obviously very different if we talk about 1.000 or 20.000€

And thanks Nyall for your amazing overview. That indeed makes things much clearer to me!

Cheers

Stéphane


Le jeudi 12 janvier 2017, Alexandre Neto <[hidden email]> a écrit :

I will share my opinion as I did in the developers list.

We users are as responsible for QGIS development as the developers. So rather than asking what QGIS can do for us, maybe we should think what we can do for QGIS. Don't just wait that a volunteer developer decide to spend his free time developing a tool that you need.

IMHO, since it seems that you are not able/willing to sponsor the feature yourself, sounds like a good opportunity for a small crowdfunding.

That way you would be able to contribute back to QGIS by giving your time in finding a developer able to do it, setting up the crowdfunding, advertise it, pay for part of it and so on.

It looks like a simple feature. It should not be very expensive (much less than an ArcGIS license for sure), and if you think many people need this, then the money will be easy to raise. And there is still time to introduce this before QGIS 3.0.

Best regards,
Alexandre Neto


A qua, 11/01/2017, 14:55, Stéphane Henriod <[hidden email]> escreveu:
Thanks for checking, that's what I realized as well!

Do you know if there is still a chance to include it for 3.0 or is it too late already?

Cheers

Stéphane


Le mercredi 11 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

I gave it a look and I'm sorry I was wrong. There have been some work on the raster classification but it was rather about color and extent management. See https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20 or https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20 but testing upcoming 3.0 shows that nothing has changed in the area you are interested in.

Harrissou

2017-01-11 4:37 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris
this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)





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

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
--
Alexandre Neto
---------------------
@AlexNetoGeo
http://gisunchained.wordpress.com


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



--
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    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...



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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

Stéphane Henriod
Dear all

we have now managed to set up a concrete offer for this feature and are now looking for funding. The costs are 4000€ and we have gathered 2000-2500€ so far.

Is there anyone on this list who also craves for this feature and would like to financially support it? I can provide any additional info offline.

Also, given the relatively low costs, I'd prefer to avoid a full-fledge crowdsourcing campaign. Too much overhead.

Thanks a lot and all the best

Stéphane


Le lundi 16 janvier 2017, Stéphane Henriod <[hidden email]> a écrit :
Hi all

I have seen that quite a few people had a look at this feature description but only few commented or modified it. Can I assume that most agree with the description as it is and would support / welcome such an implementation?

If no major concern, I would love to ask a quote to a few devs by the end of this week so that we can quickly evaluate the financial options.

Thanks a lot in advance!

Stéphane


Le jeudi 12 janvier 2017, Stéphane Henriod <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...> a écrit :
Hi all

upon advice from Andreas, I started a formal description of the requirements for such a feature:


Please, anyone interested, do check, comment, add, correct,... Once we have a "final" version, I will inquire a more precise financial estimation. Then let's see how we can move forward!

Thanks and cheers

Stéphane

Le jeudi 12 janvier 2017, Stéphane Henriod <[hidden email]> a écrit :
Hi Alexandre

(also posting on dev-)

I 100% agree with you and I would love to somehow give back to QGIS (I did already, but at a small scale).

I mostly wanted to know if I am the only one to wish for this feature. Apparently not the case: many have expressed the same wish!

Now funding: I would love to have a rough idea what "not very expensive" means. If there are any dev around who could have the interest / skills to implement this feature, can we somehow go concrete and work together on a feature description and tentative budget? The situation is obviously very different if we talk about 1.000 or 20.000€

And thanks Nyall for your amazing overview. That indeed makes things much clearer to me!

Cheers

Stéphane


Le jeudi 12 janvier 2017, Alexandre Neto <[hidden email]> a écrit :

I will share my opinion as I did in the developers list.

We users are as responsible for QGIS development as the developers. So rather than asking what QGIS can do for us, maybe we should think what we can do for QGIS. Don't just wait that a volunteer developer decide to spend his free time developing a tool that you need.

IMHO, since it seems that you are not able/willing to sponsor the feature yourself, sounds like a good opportunity for a small crowdfunding.

That way you would be able to contribute back to QGIS by giving your time in finding a developer able to do it, setting up the crowdfunding, advertise it, pay for part of it and so on.

It looks like a simple feature. It should not be very expensive (much less than an ArcGIS license for sure), and if you think many people need this, then the money will be easy to raise. And there is still time to introduce this before QGIS 3.0.

Best regards,
Alexandre Neto


A qua, 11/01/2017, 14:55, Stéphane Henriod <[hidden email]> escreveu:
Thanks for checking, that's what I realized as well!

Do you know if there is still a chance to include it for 3.0 or is it too late already?

Cheers

Stéphane


Le mercredi 11 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

I gave it a look and I'm sorry I was wrong. There have been some work on the raster classification but it was rather about color and extent management. See https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20discrete%20is%3Aclosed%20 or https://github.com/qgis/QGIS/pulls?utf8=%E2%9C%93&q=is%3Apr%20pseudocolor%20is%3Aclosed%20 but testing upcoming 3.0 shows that nothing has changed in the area you are interested in.

Harrissou

2017-01-11 4:37 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Harrissou

is there any description / documentation of the work that has been done on this (feature description, etc.)? If yes, I'd like to have a look and maybe 

Thanks a lot!

Stéphane


Le mardi 10 janvier 2017, DelazJ <[hidden email]> a écrit :
Hi Stéphane,

2017-01-10 4:02 GMT+01:00 Stéphane Henriod <[hidden email]>:
Hi Chris
this is very nice! I indeed didn't know this trick and will certainly use it again in the future!

However... :-)

I am currently teaching QGIS to beginners and this for sure is not an appropriate method for them (especially in the case you have to generate the symbology file through a script)!

Since the user can style continuous rasters with some "button-clicking", I believe the same option should be available for discrete rasters as well. 

I am thus wondering if anyone else than me sees it as a priority for QGIS? If yes, how to motivate the developers to take it for the next release and / or how much would such a development cost? (I unfortunately don't have the competences to do it myself)

There have been some work done in the raster properties dialog in the upcoming 3.0. I don't know if your concern was covered though.
If you want, you can move the question to the developer's list and discuss whether/how this can be implemented (and its requirements).

Regards,
Harrissou

Thanks again and cheers!

Stéphane


Le mardi 10 janvier 2017, Chris House <[hidden email]> a écrit :
Hi Stéphane,

I don't know if this is what you are looking for or not but I have a method of classifying rasters by color based on a set (standard) colors.  I created a spreadsheet that has several required columns, value, red, green, blue...and you can have an optional field for a display value.  So say value 1 is water you can use that last column to name that value so that in the QGIS layer tree and in legend it says Water instead of value 1. 

save the spreadsheet as a csv and change the extension to .txt instead of .csv.

I then go into the symbology section of the raster choose singleband pseudocolor. Use the folder to browse to your text file and click add.  There is a format for this text file.  It is below.  If you need me to email it I will do that in direct email.

# QGIS Generated Color Map Export File
INTERPOLATION:EXACT
-9999,0,0,0,255,NoData
0,176,176,176,255,Non-Forested
15,234,255,191,255,10 <=  CC < 20
25,187,230,149,255,20 <=  CC < 30
35,140,201,109,255,30 <=  CC < 40
45,98,176,74,255,40 <=  CC < 50
55,59,153,43,255,50 <= CC < 60
65,0,128,0,255,60 <=  CC < 70
75,15,92,11,255,70 <=  CC < 80
85,17,61,12,255,80 <=  CC < 90
95,16,36,12,255,90 <=  CC <= 100

In my example if I don't assign a value it gets ignored by QGIS.  If you are wondering how to assign unique colors to say 200 unique values...just script it.  I have done this and as long as you have the number of unique values you want and to make them unique in the script it works.

I hope this helps.  I know it isn't a "button" but to be honest I like this better.  If you already knew this...well then maybe it will help someone out in the future.

--Chris

On Mon, Jan 9, 2017 at 3:00 PM, <[hidden email].org> wrote:
Send Qgis-user mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.osgeo.org/mailman/listinfo/qgis-user
or, via email, send a message with subject or body 'help' to
        [hidden email].org

You can reach the person managing the list at
        [hidden email]g

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Qgis-user digest..."


Today's Topics:

   1. Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)


----------------------------------------------------------------------

Message: 1
Date: Mon, 9 Jan 2017 23:07:36 +0600
From: Stéphane Henriod <[hidden email]>
To: Enrico Fiore <[hidden email]>
Cc: qgis-user <[hidden email]>
Subject: Re: [Qgis-user] Symbolizing a discrete or a boolean raster
Message-ID:
        <CAK6pVBXURm_e7dRP+8SP9amPUUX0+[hidden email]ail.com>
Content-Type: text/plain; charset="utf-8"

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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> 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" <[hidden email]>
>> Data: 09/01/2017 6.30
>> A: "qgis-user"<[hidden email]geo.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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)
E    [hidden email]
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-0001.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-0001.zip>

------------------------------

Subject: Digest Footer

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

------------------------------

End of Qgis-user Digest, Vol 131, Issue 13
******************************************



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user



--
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   <a href="tel:+49%20176%2028011050" value="+4917628011050" target="_blank">+49 176 280 11 050 (DE)





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

_______________________________________________
Qgis-user mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
--
Alexandre Neto
---------------------
@AlexNetoGeo
http://gisunchained.wordpress.com


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



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



--
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    <a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;s@henriod.info&#39;);" target="_blank">s@...



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


_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Reply | Threaded
Open this post in threaded view
|

Re: Symbolizing a discrete or a boolean raster (Stéphane Henriod)

pcav
Il 02/02/2017 15:46, Stéphane Henriod ha scritto:

> Dear all
>
> we have now managed to set up a concrete offer for this feature and are
> now looking for funding. The costs are 4000€ and we have gathered
> 2000-2500€ so far.
>
> Is there anyone on this list who also craves for this feature and would
> like to financially support it? I can provide any additional info offline.
>
> Also, given the relatively low costs, I'd prefer to avoid a full-fledge
> crowdsourcing campaign. Too much overhead.

Thanks, quite useful.
I'm spreading the word.
All the best.
--
Paolo Cavallini - www.faunalia.eu
QGIS & PostGIS courses: http://www.faunalia.eu/training.html
https://www.google.com/trends/explore?date=all&geo=IT&q=qgis,arcgis
_______________________________________________
Qgis-user mailing list
[hidden email]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user