[mapserver-users] Raster color table

Daniel Morissette dmorissette at mapgears.com
Mon Dec 17 05:03:04 PST 2012


On 12-12-14 5:52 PM, ALT SHN wrote:
> Hi,
>
> Is there a way to associate a color table to a 8bit raster so Mapserver
> doesn't render it in grayscale?
> In the Mapserver documentation, a pallete is refered, but for what I
> understood, this applies to the output format, not to a particular raster.
>
> Is there a workarround for this situation? (other than converting the
> raster to RGB)
>

You could create a GDAL VRT file for your image in which you associate a 
color table to the raster band, and then point your MapServer layer 
definition to the VRT.

See:

http://trac.osgeo.org/gdal/wiki/FAQRaster#Howtocreateormodifyanimagecolortable

and

http://www.gdal.org/gdal_vrttut.html


-- 
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000




More information about the MapServer-users mailing list