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

Int images with floating point gain not displayed properly #19835

Closed
qgib opened this issue Nov 5, 2014 · 5 comments
Closed

Int images with floating point gain not displayed properly #19835

qgib opened this issue Nov 5, 2014 · 5 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)

Comments

@qgib
Copy link
Contributor

qgib commented Nov 5, 2014

Author Name: Matthew Hanson (Matthew Hanson)
Original Redmine Issue: 11573
Affected QGIS version: 2.6.0
Redmine category:rasters


In 2.4 a new feature was introduced that was to apply the gain and offset, if there was one, to the read and displayed image.

However QGIS appears to honor the original data type of the image after the gain and offset are applied.

To reproduce:

  • Take an Int typed image with a floating point gain. For example, an NDVI image stored as Int16 might have a gain of 0.001 to yield values generally in the range of -1.0 to 1.0.

  • Open in QGIS. The image will appear black/white/gray.

  • Examine with Identify Feature. Image is made up of only -1's, 0's and 1's (depending on individual image), as if the gain was applied but the data type was still integer

Note that the statistics generated are properly in floating point. However the display, and the pixels as reported by Identify Feature, are ints.

This bug is present in 2.4 and 2.6. Verified on multiple Ubuntu desktop and server machines, both 12.04 and 14.04.

@qgib
Copy link
Contributor Author

qgib commented Nov 5, 2014

Author Name: Giovanni Manghi (@gioman)


please attach/link sample data.


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Nov 5, 2014

Author Name: Matthew Hanson (Matthew Hanson)


Link to example data.

TIF NDVI image. Int16, ranging from -26512 to 11716 with a gain of 0.0001:
http://geo.ags.io/static/2014141_LC8_ndvi.tif

QGIS 2.2 reports numbers as the original ints, and is correct (although without gain) in the above range.

QGIS 2.4, 2.6 reports numbers statistics properly as -2.6512 to 1.1716, but the image is displayed as all 0's.

With the gain removed 2.6 behaves as 2.2.

Same image, with no gain set:
http://geo.ags.io/static/2014141_LC8_ndvi_nogain.tif

@qgib
Copy link
Contributor Author

qgib commented Dec 3, 2014

Author Name: Matthew Hanson (Matthew Hanson)


I would like to request that the "feature" of applying Gain and Offset be reverted until this bug is fix. As it stands QGIS is completely unusable if you store floating point images as Int16 to save space (a very common thing to do for storing indices such as NDVI). We have had to peg our QGIS at 2.2.

@qgib
Copy link
Contributor Author

qgib commented Dec 4, 2014

Author Name: Giovanni Manghi (@gioman)


Matthew Hanson wrote:

I would like to request that the "feature" of applying Gain and Offset be reverted until this bug is fix. As it stands QGIS is completely unusable if you store floating point images as Int16 to save space (a very common thing to do for storing indices such as NDVI). We have had to peg our QGIS at 2.2.

I'm not sure I completely understand the issue, anyway I suggest you to raise the problem in the developers mailing list, where there is a much larger "audience".

@qgib
Copy link
Contributor Author

qgib commented Mar 5, 2015

Author Name: Nyall Dawson (@nyalldawson)


Fixed in changeset "914ecc9c0980012b27b15ce5616cf5541da66f55".


  • status_id was changed from Feedback 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 25, 2019
@qgib qgib closed this as completed May 25, 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