1

I have an RGB GeoTIFF with 16-bits for each channel. When I try to use Mapnik with it to render a PNG (or a tileset), I end up with all values (clipped to?) white. Transparency is working, so I know its parsed the data in the file, but the style hasn't correctly scaled the RGB data to fit in 8-bits.

enter image description here

I believe GDAL is returning data to Mapnik correctly, but Mapnik is assuming channel data is in the range 0-255, whereas with 16-bits per channel, the values will range from 0-66535.

I tried using an HSLA filter in the Mapnik style to scale the values down, but it appears that they're already clipped by the time the HSLA filter gets access to the data:

<Map>
  <Style filter-mode="first" name="imagery" direct-image-filters="scale-hsla(0,1, 0,1, 0,0.01, 0,1)">
    <Rule>
      <RasterSymbolizer comp-op="dst-over" />
    </Rule>
  </Style>
</Map>

Any suggestions how I can load a multi-band RGB GeoTiff with uint16 samples with Mapnik? I'd really rather not save a temporary file to disk and deal with all the garbage collection that entails...

Seth
  • 2,712
  • 3
  • 25
  • 41

0 Answers0