Bug report #4193

GRASS Rasters are not drawn with user-defined style

Added by Anita Graser about 8 years ago. Updated over 7 years ago.

Status:Closed
Priority:High
Assignee:-
Category:GRASS
Affected QGIS version:master Regression?:No
Operating System:all Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:14168

Description

GRASS rasters are drawn in gray after loading them using GRASS toolbox. When the style is then changed, the raster stops being drawn at all. Closing and re-opening layer dialog shows that Single Band Properties - Gray Band can only be set to "" or "Not set".

Reproducible for example using these steps:
Load a point file into GRASS mapset and create a raster using v.neighbor. Add to QGIS map and try to style using Color map.

I reproduced this using nightly builds on both Ubuntu Natty and OSGeo4W on Win7.

History

#1 Updated by Paolo Cavallini about 8 years ago

AKAIK, color should be given to GRASS rasters through GRASS commands (r.colors). I agree this is a bit inconvenient, but more reliable and consistent.

#2 Updated by Anita Graser about 8 years ago

  • Target version changed from Version 1.7.1 to Version 2.0.0

This is a new bug in nightly.

Styling GRASS rasters using QGIS layer properties works in 1.7 and did in all previous versions as far as I remember.

This bug makes using GRASS rasters a real pain and decreases the user experience.

#3 Updated by Paolo Cavallini almost 8 years ago

Further testing: I agree, the current behaviour renders the usage very cumbersome.

#4 Updated by Giovanni Manghi almost 8 years ago

Anita Graser wrote:

This is a new bug in nightly.

Styling GRASS rasters using QGIS layer properties works in 1.7 and did in all previous versions as far as I remember.

This bug makes using GRASS rasters a real pain and decreases the user experience.

confirmed on both linux and windows in qgis/trunk

#5 Updated by Radim Blazek almost 8 years ago

There were 2 problems:

1) bandName and bandNumber were not set on raster band stats and thus the band could not be found and it was not listed in combo - fixed in d848aa00.

2) Before 4d56f98f, StretchToMinimumMaximum was default, which was working well with GRASS where min/max values are always (should be), but it was making other data types (GDAL) slow, because min/max values has to be calculated (sometimes). Using NoStretch as default OTOH caused GRASS rasters be drawn as gray rectangles, because value range could be much smaller than possible data range. 08293fd4 sets min/max values and StretchToMinimumMaximum for singleband if min/max values are available. This is problem however, because a different default enhancement algorithm is shown in GUI.

The main problems are fixed but this ticket should not be closed until the GUI discrepancy is solved - maybe a new ticket should be opened.

Especially the second commit should be well tested before backport to 1.7/1.8.

#6 Updated by Radim Blazek almost 8 years ago

BTW, it seems that there is no way to set defaultContrastEnhancementAlgorithm apart manual setings file editing.

#7 Updated by Giovanni Manghi over 7 years ago

  • Crashes QGIS or corrupts data set to No
  • Status changed from Open to Closed
  • Resolution set to fixed
  • Affected QGIS version set to master

The main problems are fixed but this ticket should not be closed until the GUI discrepancy is solved - maybe a new ticket should be opened.

I believe we can document that for GRASS rasters stretching will be always enabled

Especially the second commit should be well tested before backport to 1.7/1.8.

for now seems to work fine, so I'll close the ticket and eventually reopen it if something surfaces later.

Also available in: Atom PDF