Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong legends/ramps for rasters #14658

Closed
qgib opened this issue Jan 13, 2012 · 11 comments
Closed

Wrong legends/ramps for rasters #14658

qgib opened this issue Jan 13, 2012 · 11 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Rasters Related to general raster layer handling (not specific data formats)
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Jan 13, 2012

Author Name: Giovanni Manghi (@gioman)
Original Redmine Issue: 4806
Affected QGIS version: master
Redmine category:rasters


Steps:

  • add the attached raster (is a DEM)

  • calculate the "aspect" map with the terrain analysis tool or with the gdaldem tool

The min/max values of the output are

STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=359.87353515625

but the legend will show values as

-9.8
398.8

which do not make any sense (see attached screenshot)

Another example is if you reclassify (with the raster calculator) the same DEM to a map with just "0" and "1"

  • (dem_clipped@1>300)*1 + (dem_clipped@1<=300)*0

the resulting map will show a legend with values as

0.3
1.4

that once again do not make any sense.


@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2012

Author Name: Alexander Bruy (@alexbruy)


Not reproducible here with latest qgis-dev (-37) from OSGeo4W under 32bit Windows XP Pro SP3. Also tested under 32bit Slackware 13.37 with latest master (4413a7d), GDAL 1.9.0 with same result — not reproducible.

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2012

Author Name: Giovanni Manghi (@gioman)


Alexander Bruy wrote:

Not reproducible here with latest qgis-dev (-37) from OSGeo4W under 32bit Windows XP Pro SP3. Also tested under 32bit Slackware 13.37 with latest master (4413a7d), GDAL 1.9.0 with same result — not reproducible.

Hi Alexander, that's weird, I also tested qgis master on both Windows and Linux. Do you mean that you are getting legends with the expected values?

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2012

Author Name: Alexander Bruy (@alexbruy)


Giovanni Manghi wrote:

Hi Alexander, that's weird, I also tested qgis master on both Windows and Linux. Do you mean that you are getting legends with the expected values?

Right, I get correct legend values. In case with reclassified DEM this is 0 and 1. In case with "aspect" analysis results this is 0.14579 and 360. Maybe this is because you use 64bit system?

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2012

Author Name: Giovanni Manghi (@gioman)


Alexander Bruy wrote:

Giovanni Manghi wrote:

Hi Alexander, that's weird, I also tested qgis master on both Windows and Linux. Do you mean that you are getting legends with the expected values?

Right, I get correct legend values. In case with reclassified DEM this is 0 and 1. In case with "aspect" analysis results this is 0.14579 and 360. Maybe this is because you use 64bit system?

My Linux box is 64 bit but my Windows VM is 32 bit, so should be something else. But what?

@qgib
Copy link
Contributor Author

qgib commented Jan 16, 2012

Author Name: Paolo Cavallini (@pcav)


Confirmed here on Debian unstable 64bit (values from -8 to +399)

@qgib
Copy link
Contributor Author

qgib commented Jan 16, 2012

Author Name: Giovanni Manghi (@gioman)


But I'm sure I got the same also on a 32bit system...

@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2012

Author Name: Giovanni Manghi (@gioman)


loading the attached raster (dem_lipped.tif), without applying any particular color map, in the legend I see a "-32767-32768" that I also don't uderstand


  • 4185 was configured as dem_clipped.tif

@qgib
Copy link
Contributor Author

qgib commented Jan 22, 2012

Author Name: Alexander Bruy (@alexbruy)


Giovanni Manghi wrote:

loading the attached raster (dem_lipped.tif), without applying any particular color map, in the legend I see a "-32767-32768" that I also don't uderstand

Confirmed but only when contrast enhacement is "Not set" or "Clip to MinMax". In all other cases I get correct values.
After looking into code I found that legend values are gathered from QgsContrastEnhancement object, so if contrast enhacement is "Not set" there are no values found and defaults used.

@qgib
Copy link
Contributor Author

qgib commented Apr 16, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.7.4 to Version 1.8.0

@qgib
Copy link
Contributor Author

qgib commented Sep 4, 2012

Author Name: Paolo Cavallini (@pcav)


  • fixed_version_id was changed from Version 1.8.0 to Version 2.0.0

@qgib
Copy link
Contributor Author

qgib commented Oct 4, 2012

Author Name: Giovanni Manghi (@gioman)


This has been fixed in master.


  • resolution was changed from to fixed
  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Rasters Related to general raster layer handling (not specific data formats) labels May 24, 2019
@qgib qgib added this to the Version 2.0.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Rasters Related to general raster layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant