Feature request #14845

Add an option to automatically classify discrete rasters when styling them

Added by shenriod - about 4 years ago. Updated over 3 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Symbology
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:22798

Description

Hi

I am currently working with discrete rasters (landuse categories, boolean rasters...) and there seems to be no straight-forward way to style them.

If I have 30 landuse classes (1, 2, 3,... , 30), I need to use "Single-band pseudo-colour" and to add my 30 values manually. Moreover, if I don't want to display values 18,19,20 and remove them from the list, the pixels with those values will still be displayed (with colours interpolated between 17 and 21).

Would be great to have an additional "Render type" for discrete rasters. It should offer the option to automatically "retrieve all unique values" (like ArcGIS does). The renderer should then only display the pixels matching this list of values. Pixels with other values will just be ignored, not interpolated.

See for reference here

Thanks!

Selection_076.png (176 KB) shenriod -, 2016-05-19 10:35 PM

landcover.zip (2.1 KB) shenriod -, 2017-01-10 03:04 AM

Associated revisions

Revision d03844d2
Added by Nyall Dawson over 3 years ago

[FEATURE] Allow classifying paletted renderer using unique values
from a raster layer

Adds an easy way to style discrete rasters such as landuse classes
using the Paletted renderer. Just select the Paletted renderer,
pick a band, then hit the "Add Unique Values" button. The unique
pixel values will be fetched from the layer and a color assigned
to each using the currently selected color ramp.

Fix #14845

Sponsored by
- St├ęphane Henriod
- Satelligence (http://satelligence.com/)
- Bird's Eye View (https://www.birdseyeviewgis.com/)
- + other anonymous backers

History

#1 Updated by shenriod - about 4 years ago

Related to this (old) request #4321

And to this one: #14449

#2 Updated by Giovanni Manghi about 4 years ago

  • Category set to Symbology

#3 Updated by shenriod - over 3 years ago

I am not familiar with the etiquette of the ticketing system so sorry if I'm not posting at the right place!

I have the feeling that this requested feature (styling boolean or discrete rasters) is quite "basic" for a professional GIS software like QGIS. Any chance this request can get some attention? :-)

Thanks!

#4 Updated by Giovanni Manghi over 3 years ago

shenriod - wrote:

I am not familiar with the etiquette of the ticketing system so sorry if I'm not posting at the right place!

I have the feeling that this requested feature (styling boolean or discrete rasters) is quite "basic" for a professional GIS software like QGIS. Any chance this request can get some attention? :-)

Thanks!

I agree, there is a lot of room for improvements about discrete rasters.

Anyway while QGIS is fundamentally users necessity driven, do not expect someone wake up in the morning and add/fix (for free or just because) what is for you/me an important feature. Raise your concerns in the users/developers mailing lists and see if the request gains momentum and if is possible to put together a group of people willingly to support the request.

#6 Updated by Rick Rupp over 3 years ago

I agree this is a feature that I very much would like to see/support.

#7 Updated by shenriod - over 3 years ago

Adding a typical (fake) discrete raster if anyone wants to make tests

#8 Updated by Martin Dobias over 3 years ago

Just a note - if you do not want colors to be interpolated, just set the interpolation type to "Exact". This will solve the issue that raster value 5 still gets rendered (as mentioned in the screenshot).

Also you do not need to add all the values manually, you can set min value to 1, max value to 30, number of classes to 30 and the list of colors will be populated by entries as wanted. Of course having a button to fetch all distinct values from raster would be useful...

Multi-selection of classes to edit or remove them would be handy.

In the mail to qgis-dev list you mentioned loading/saving of color maps - that's already possible, look for load/save buttons.

#9 Updated by Andy Harfoot over 3 years ago

I have posted a workaround in the form of a Processing script as an answer to the GIS SE question on the same topic http://gis.stackexchange.com/questions/194116/qgis-style-a-discrete-raster

It's rough and ready, but does the trick.

#10 Updated by Nyall Dawson over 3 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF