two colored output needed

Manfred Zerndl manfred.zerndl at BVV.BAYERN.DE
Thu Nov 8 06:52:16 PST 2007


Hi List,

i have some raster tiles in TIFF format.
gdalinfo tells me the following:

------- begin -- gdalinfo -----
Driver: GTiff/GeoTIFF
Size is 13000, 13000
Coordinate System is `'
Origin = (4526459.127166650258005,5316969.772833350114524)
Pixel Size = (0.211666700000000,-0.211666700000000)
Metadata:
 TIFFTAG_DOCUMENTNAME=Standard Input
 TIFFTAG_IMAGEDESCRIPTION=converted PNM file
 TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
Image Structure Metadata:
 COMPRESSION=CCITTFAX4
Corner Coordinates:
Upper Left  ( 4526459.127, 5316969.773)
Lower Left  ( 4526459.127, 5314218.106)
Upper Right ( 4529210.794, 5316969.773)
Lower Right ( 4529210.794, 5314218.106)
Center      ( 4527834.961, 5315593.939)
Band 1 Block=13000x1 Type=Byte, ColorInterp=Palette
 Metadata:
   NBITS=1
 Color Table (RGB with 2 entries)
   0: 255,255,255,255
   1: 0,0,0,255
---- end -- gdainfo -----


I have defined following outputformat in th mapfile:

OUTPUTFORMAT
       NAME HLTIFF
       DRIVER "GDAL/GTiff"
       EXTENSION "tif"
       MIMETYPE "image/tif"
       IMAGEMODE PC256
       FORMATOPTION "QUANTIZE_FORCE=ON"
       FORMATOPTION "QUANTIZE_DITHER=OFF"
       FORMATOPTION "QUANTIZE_COLORS=2"
       FORMATOPTION "COMPRESS=GROUP4"
END

When I create a tileindex for mapserver then the response tile  has a 
color table
with many colors entries, but only two colors are needed.
So the file is bigger than necessary.
Maybe I need some kind of "IMAGEMODE  PC2" but this is not possible.

How can i force mapserver to generate two-colored tiles?
It is not important what format the genereted tile is
(PNG or JPEG would be nice, but TIFF is also ok).


Best Regards,

Manfred Zerndl



More information about the MapServer-users mailing list