Or we can just use NaN for float/double and float + NaN for byte/int? Radim
On Sun, Jan 16, 2011 at 11:29 AM, Radim Blazek <radim.bla...@gmail.com> wrote: > On Thu, Jan 13, 2011 at 9:04 AM, Marco Hugentobler > <marco.hugentob...@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. > Radim > _______________________________________________ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer