Bug report #832

Raster cell coount returns incorrect value

Added by Tim Sutton over 12 years ago. Updated over 10 years ago.

Status:Closed
Priority:Low
Assignee:Tim Sutton
Category:Build/Install
Affected QGIS version: Regression?:No
Operating System:All Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:10891

Description

Original report submitted by Enrico Chiaradia:

Currently I use the "ganymede" release and I have to submit this
problem: when I load an ASCII raster grid (see attached file), I find in
metadata file properties many informations like mean value and the
number of cells with value different from no-data value. At the moment,
these informations are not correct. In the attached file, you can see
that the total number of cell with a different value from nodata are
100; Qgis reports only 99 and this problem affects also average value.
I hope that this information is useful and also I wish to actively
contribute to the project in the future.
Kindly Regards

Enrico Chiaradia

University of Milan, Italy.

NCOLS 10
NROWS 10
XLLCENTER 1535380.000000
YLLCENTER 5083260.000000
DX 10
DY 10
NODATA_VALUE -9999
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
0 1 2 3 4 5 6 7 8 9
PROJECTION
NOTES

History

#1 Updated by Tim Sutton over 12 years ago

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

I found the problem and have committed a fix for it as d082db63 (SVN r7651). The fixed version will be in the release of QGIS 0.9.1 next month and is availably imediately from SVN trunk if you compile from source. I also add a regression test to catch this bug agan with our unit tests if it ever comes back some how.

Raster metadata for the layer now returns:


Propriedade Valor
Banda Undefined
No da Banda 1
Val Min 0.0000000000
Val Máx 9.0000000000
Intervalo 9.0000000000
Média 4.5000000000
Soma das raízes 824.9521674896
Desvio Padrão 2.8866676595
Soma de todas as células 450.0000000000
Número de Células 100


If you would like to make more bug reports please let me know your preferred user name and password and I will create an account on our qgis trac site for you. We prefer bugs reported via the bug tracker since its less likely they will be overlooked in our overflowing mail boxes. You are always welcome to email me citing a particlar bug in the queue if you have something particularly urgent that needs attention (assuming I am ablt to help with it).

Best regards

Tim

#2 Updated by Anonymous over 10 years ago

Milestone Version 0.9.1 deleted

Also available in: Atom PDF