Bug report #6900

GRASS raster stretching is not applied in QGIS master on project load

Added by Giovanni Manghi almost 7 years ago. Updated over 6 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Radim Blazek
Category:Project Loading/Saving
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:16025

Description

It works fine in QGIS 1.8.

Basically when opening a project with a GRASS raster, QGIS calculates in a wrong way the min/max values (you can see from raster properties) and so the stretching (on project load) is not applies (grey rectangle).

The user can then re-compute min/max values and the stretching is correctly applied.

Capture.PNG (102 KB) Giovanni Manghi, 2012-12-20 06:51 AM

Capture2.PNG (145 KB) Giovanni Manghi, 2012-12-20 06:51 AM

Associated revisions

Revision dbb0730d
Added by Radim Blazek over 6 years ago

disabled raster data file timestamp check in loading style, fixes #6900

History

#1 Updated by Radim Blazek almost 7 years ago

Does it happen only if an existing project is loaded or also if a new GRASS layer is added?

What do you see in raster properties? Min/max values correctly set and contrast enhancement set to Stretch to MinMax and it does not render correctly?

The project was created with 1.8 or master?

#2 Updated by Giovanni Manghi over 6 years ago

Radim Blazek wrote:

Does it happen only if an existing project is loaded or also if a new GRASS layer is added?

only when loading from project

What do you see in raster properties? Min/max values correctly set and contrast enhancement set to Stretch to MinMax and it does not render correctly?

see attached screenshot:

no CE when it should be, and min/max values wrong

The project was created with 1.8 or master?

master

#3 Updated by Radim Blazek over 6 years ago

Only with GRASS? All rasters?

I cannot confirm, it works here.

#4 Updated by Giovanni Manghi over 6 years ago

Radim Blazek wrote:

Only with GRASS? All rasters?

I cannot confirm, it works here.

project and mapset here

http://dl.dropbox.com/u/37037501/essentia.7z

#5 Updated by Radim Blazek over 6 years ago

  • Status changed from Open to Closed
  • Resolution set to worksforme

Your layer in project file has

   <contrastEnhancement>
      <minValue>-2.14748e+09</minValue>
      <maxValue>2.14748e+09</maxValue>
      <algorithm>0</algorithm>
   </contrastEnhancement>

if I add the same layer to that project and save it, it has
   <contrastEnhancement>
     <minValue>219.136</minValue>
     <maxValue>1659.36</maxValue>
     <algorithm>1</algorithm>
   </contrastEnhancement>

I don't think it is related to GRASS. I cannot help you.

#6 Updated by Giovanni Manghi over 6 years ago

  • Category changed from Rasters to Project Loading/Saving
  • Status changed from Closed to Reopened
  • Resolution deleted (worksforme)

It may be not a GRASS issue, but still an issue and a regression.

#7 Updated by Radim Blazek over 6 years ago

  • Status changed from Reopened to Closed

#8 Updated by Radim Blazek over 6 years ago

Sorry Giovanni, your project file was correct, I was wrong.

Raster layer was checking timestamp of data file stored with style so that if data changed (for example min/max changed) symbology was completely recreated. However it could may make sense in some cases, it would probably cause more problems and confusion (e.g. if file + project are copied) so I disabled the timestamp check.

Also available in: Atom PDF