https://issues.qgis.org/https://issues.qgis.org/favicon.ico2009-02-15T09:09:03ZQGIS Issue TrackingQGIS Application - Bug report #1497: colormap edge case handling wrong for negative valued rastershttps://issues.qgis.org/issues/1497?journal_id=184142009-02-15T09:09:03Zersts -ersts@foo.bar
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>In Progress</i></li></ul><p>Replying to <a href="/issues/show/1497">Barryrowlingson</a>:</p>
<blockquote>
<p>If things were symmetric with the positive raster, it should be red, but it doesn't get shaded.</p>
<p>As it is, it seems that a positive floating point raster will always have cells of the single max colour done in one shade, and a negative fp raster will always have cells of the minimum colour set transparent...</p>
</blockquote>
<p>If there is a pixel > -0.563 it should be shaded red, but if there is a pixel < -8.38 it will not be shaded.</p>
<p>Check out the trunk and see if your problem still exists. I am not sure I totally understand your explanation and may be missing something. If the problem still exists, please post an ascii version of your 20x20 grid and your color map.</p>
<blockquote>
<p>Also note the 'Exact' interpolation doesn't match any cells - I thought it might find equality with the min and max cells, but doesn't. Probably only useful for integer rasters.</p>
</blockquote>
<p>Check your values outside of qgis, or better yet try with an ascii grid. It should work for all data. Part of the issue has to do with gdal gives data as float but it is used throughout the raster class as doubles and the problem comes down to comparing the type of values. Your color map entry may be 1.05 but the value may be 1.050000000000001 in the data. This issues shows up with the no data value as well. Really need to go back to if( Value1 - Valu2 ) < some constant ( e.g. 0.0000000001 ) Consider the values equal.</p> QGIS Application - Bug report #1497: colormap edge case handling wrong for negative valued rastershttps://issues.qgis.org/issues/1497?journal_id=184152009-02-16T04:24:09Zbarryrowlingson -barryrowlingson@foo.bar
<ul></ul><p>Hmm I've just tried with some other rasters and it doesn't happen, so it's dependent on the values in the raster.... I'm trying to create a minimal raster that reproduces the problem. Will post later.</p>
<p>If it's a problem with precision it's not my fault - Qgis is creating the classification edges and so ought to make sure all the data is within the bounds.</p> QGIS Application - Bug report #1497: colormap edge case handling wrong for negative valued rastershttps://issues.qgis.org/issues/1497?journal_id=184162009-02-16T05:13:27Zbarryrowlingson -barryrowlingson@foo.bar
<ul></ul><p>Here's two 3x2 esri grid files - one exhibits the problem, the other doesn't:</p>
<pre>
NCOLS 3
NROWS 2
CELLSIZE 0.9125
XLLCORNER 12.15
YLLCORNER -5.81
NODATA_value -26
-2.66226 -2.720158 -3.119102
-1.747691 -1.321416 -1.096483
NCOLS 3
NROWS 2
CELLSIZE 0.9125
XLLCORNER 12.15
YLLCORNER -5.81
NODATA_value -26
-2.66226 -2.720158 -3.119102
-1.747691 -1.321416 -1.196483
</pre>
the only difference between them is I've changed the max value from -1.096483 to -1.196483.
<p>For the first grid, that cell shows up as white, for the second grid it is coloured okay.</p>
<p>Recap: load grid, Properties, set 'Colormap' mode, on colormap tab choose 4 entries, classify, apply.</p>
<pre><code>This is on 1.0.0 Kore release - I've not got a build environment up at the moment. If all this has changed a lot in HEAD then maybe it's all fixed. I might try and sort out building later.</code></pre>
<p>thx for looking into this.</p> QGIS Application - Bug report #1497: colormap edge case handling wrong for negative valued rastershttps://issues.qgis.org/issues/1497?journal_id=184172009-03-11T14:36:15Zersts -ersts@foo.bar
<ul><li><strong>Resolution</strong> set to <i>fixed</i></li><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li></ul><p>It is was I expected, a problem comparing doubles. Even thought -1.196483 was in the ascii grid and the color map the == comparison was not returning true.</p>
<p>I would like folks to test this a little more before merging it into the V1.0 branch.</p> QGIS Application - Bug report #1497: colormap edge case handling wrong for negative valued rastershttps://issues.qgis.org/issues/1497?journal_id=184182009-08-21T23:02:39ZAnonymous
<ul></ul><p>Milestone Version 1.0.2 deleted</p>