[Qgis-developer] Re: Raster providers

Radim Blazek radim.blazek at gmail.com
Sun Jan 16 05:29:37 EST 2011

On Thu, Jan 13, 2011 at 9:04 AM, Marco Hugentobler
<marco.hugentobler at sourcepole.ch> wrote:
> With one of my favorite test dataset, I noted a problem with automatic
> assignment of nodata value and automatic insertion into the transparency list.
> In that case, the raster is a colortable map (byte) and has no nodata value.
> So 255 is set to transparent and the map appears completely different than
> expected...

The problem is that with reprojection we always need null values even
if not defined by raster. At moment I just assigned the max value for
each data type which is obviously wrong as you proved.
The question is how to passed null values from provider to raster
layer. We could:

1) scan all values for a not used value, but it can slow down first
loading and it is not always successful (for short data types all
values may be occupied)

2) always use longer data type (int for byte, float for int etc), the
bigger size probably is not problem because we usually need only a
block of data for screen (for double it is max around 1600*1200*8 =
14MB), but what about Float64 - could/should we use long double, it
can be 96 or 128 bits and not available on ARM(?) etc...

3) probably the right solution would be to use separate bit matrix as
null flags, but that would complicate too much the implementation

Maybe a combination of 1+ 2? 1 for shorter types - byte/int and 2 for
float/double? How to find quickly a not used value?

I am waiting for your ideas.

More information about the Qgis-developer mailing list