[GRASS-user] FCELL, Float32 and colors

Hi everyone!

I have an FCELL raster that I need to export it to distribute it on a webgis. I’ve used r.out.gdal to produce a Float32 Geotiff (to mantain the original floating values), but I’ve lost my color table, as gdal cannot associate a LUT to a 32 bit output. The result is a grey scaled image.

Is there a way to change the color table of a 32 bit image? I would need to use my predefined color ramp, and make Mapserver output the colored raster with the original values.
Otherwise I have to export as Byte, but I loose the original pixel values…

Thanks for your help.

G. Allegri wrote:

I have an FCELL raster that I need to export it to distribute it on a
webgis. I've used r.out.gdal to produce a Float32 Geotiff (to mantain the
original floating values), but I've lost my color table, as gdal cannot
associate a LUT to a 32 bit output. The result is a grey scaled image.

Is there a way to change the color table of a 32 bit image? I would need to
use my predefined color ramp, and make Mapserver output the colored raster
with the original values.
Otherwise I have to export as Byte, but I loose the original pixel values...

This is a limitation of the data format rather than the software. I'm
not aware of any "image" format which supports GRASS-style colour
tables (IIRC, GDAL can embed the GRASS colour table in a private
chunk, but I'm not aware of any software which can make use of that
data).

One possibility is to export the data as two separate files, one
containing the floating-point data and the other a normal RGB image.

--
Glynn Clements <glynn@gclements.plus.com>

On 04/01/08 12:49, Glynn Clements wrote:

This is a limitation of the data format rather than the software. I'm
not aware of any "image" format which supports GRASS-style colour
tables (IIRC, GDAL can embed the GRASS colour table in a private
chunk, but I'm not aware of any software which can make use of that
data).

One possibility is to export the data as two separate files, one
containing the floating-point data and the other a normal RGB image.

Is there any de-facto standard for a color table that we could export a grass color table to ?

Moritz

I’m trying to solve it multiplying my raster x1000000 and then converting it to integer… This is the problem: how to convert (rounding) a floating raster to an integer one? I suppose I should use r.quant, but I can’t make it work as I’ve never used it.
Any hints?

Giovanni

On 04/01/08 12:49, Glynn Clements wrote:

This is a limitation of the data format rather than the software. I’m
not aware of any “image” format which supports GRASS-style colour
tables (IIRC, GDAL can embed the GRASS colour table in a private
chunk, but I’m not aware of any software which can make use of that
data).

One possibility is to export the data as two separate files, one
containing the floating-point data and the other a normal RGB image.

Is there any de-facto standard for a color table that we could export a
grass color table to ?

Moritz

On 04/01/08 14:06, G. Allegri wrote:

I'm trying to solve it multiplying my raster x1000000 and then converting it to integer... This is the problem: how to convert (rounding) a floating raster to an integer one? I suppose I should use r.quant, but I can't make it work as I've never used it.
Any hints?

r.mapcalc out=round(in) to round or out=int(in) to truncate.

Moritz

Moritz Lennert wrote:

> This is a limitation of the data format rather than the software. I'm
> not aware of any "image" format which supports GRASS-style colour
> tables (IIRC, GDAL can embed the GRASS colour table in a private
> chunk, but I'm not aware of any software which can make use of that
> data).
>
> One possibility is to export the data as two separate files, one
> containing the floating-point data and the other a normal RGB image.

Is there any de-facto standard for a color table that we could export a
grass color table to ?

Colour-mapped image formats invariably store the colour table as an
array. That rules out floating point, and it essentially rules out
32-bit integers (most formats are limited to 8 bpp).

--
Glynn Clements <glynn@gclements.plus.com>