Outputting 8-bit GeoTIFF with PCT: extra entry?

Avi A Blackmore sysadmin at SATSHOT.COM
Wed Mar 1 17:49:00 EST 2006


Hi there,

	I'm working on a raster density-slicing application using Mapserver 4.6.0, which classifies the pixels into discrete "zones" based on the range
of pixel values.  What I'm shooting for is a single band GeoTIFF, whose raster cell values are either 0 (meaning "no data") or a number corresponding
to the zone that the source cell was classified as by Mapserver, and then a color table entry which corresponds to the zone's coloring in the style object.

	That is, if I sliced an NIR satellite image into 7 zones, what I want is for the raster cells to have values 1-7, and color table entries 0-7 to be filled with
the corresponding color for that class (or the OFFSITE color for values of 0).  This way, an application can determine the zone just by reading the raster cell value.

	What I get, however, is a raster whose cells have values 2-8, with the color table entries 2-8 having the zone color values, and color table entry 1 being set
to 0, 0, 0.  GDAL in Python reports that the resulting raster does not have any pixels with value of 1: the values are either 0 or 2-8.  This effect shows up regardless
of the number of zones I slice the image into: at 30 zones, I get color table entries 0-31 filled, with this spurious "black" at entry 1.  I have checked carefully, the number
of classes in the raster layer, and they always match exactly the number of zones.

	So, what's going on here?  I'm using the GDAL output driver to write the GeoTIFFs.  I'm not sure if there is any other information that might be useful or necessary.

-- 
Avi Blackmore
System Administrator/Programmer
Agri ImaGIS Technologies, Inc.



More information about the mapserver-users mailing list