[QGIS-trac] [Quantum GIS] #1497: colormap edge case handling wrong
for negative valued rasters
Quantum GIS
qgis at qgis.org
Tue Jan 20 07:25:52 EST 2009
#1497: colormap edge case handling wrong for negative valued rasters
------------------------------------------------+---------------------------
Reporter: Barryrowlingson | Owner: nobody
Type: bug | Status: new
Priority: major: does not work as expected | Milestone: Version 1.0.1
Component: Rasters | Version: HEAD
Keywords: | Platform_version:
Platform: Linux | Must_fix: No
Status_info: 0 |
------------------------------------------------+---------------------------
I have a single-band floating-point raster. It's 20x20 so I can see the
cells.
From layer properties choose 'Colormap', on the Colormap tab use Discrete
Color Interpolation, in generate new color map section choose 4 entries,
equal interval color map, hit Classify, hit apply.
The colormap values define inclusive upper values. For a positive-valued
raster I get three areas of color and a single cell coloured in the shade
of the smallest value, since that's the only cell which has the minimum
value.
But for a negative-valued raster I get three areas of colour and a blank
cell at the highest value.
Let's explain with some colormaps. My positive raster has a range of
0.563 to 8.38, and I get this colormap:
0.563: blue
3.169: yellow
5.775: green
8.38 : red
I see one blue cell (at the single pixel with the minimum value) and some
yellow, green and red cells. All cells are shaded.
With my negative raster (which is just (* -1 pos) in RasterLang) I get the
following colormap:
-8.38 : blue
-5.775: yellow
-3.169: green
-0.563: red
and I see one transparent cell, no blue cells, and some yellow, green and
red cells. The transparent cell is at the -0.563 value location. See
attachment.
If things were symmetric with the positive raster, it should be red, but
it doesn't get shaded.
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...
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.
--
Ticket URL: <https://trac.osgeo.org/qgis/ticket/1497>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list