Bug #4193

GRASS Rasters are not drawn with user-defined style

Added by Anita Graser almost 2 years ago. Updated over 1 year ago.

Status:Closed Start Date:08/20/2011
Priority:High Due date:
Assigned to:- % Done:

0%

Category:GRASS
Target version:Version 2.0.0
Platform:all Patch supplied:No
Platform version: Affected version:master
Status info: Causes crash or corruption:No
Resolution:fixed

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

Updated by Paolo Cavallini almost 2 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.

Updated by Anita Graser almost 2 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.

Updated by Paolo Cavallini over 1 year ago

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

Updated by Giovanni Manghi over 1 year 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

Updated by Radim Blazek over 1 year 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.

Updated by Radim Blazek over 1 year ago

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

Updated by Giovanni Manghi over 1 year ago

  • Status changed from New to Closed
  • Resolution set to fixed
  • Affected version set to master
  • Causes crash or corruption set to No

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