Preventing scaling during raster rendering in MapServer

Geographic Information Systems Asked on January 6, 2022

I have encoded some metrics in a 4-band geotiff that will be served by MapServer (v7.4), and I want to "decode" them client-side for display using raster operations in OpenLayers (v6.1). (This is something somewhat similar to what is done in this openlayers workshop.)

The problem is that my metrics values range from 1 to 156 (and I used 255 for nodata), and MapServer scale them to 0-254 during rendering for better display, so the client do not have access to the original metrics.

I would need the client to have access to the original values. I have tried adding the following directives to the mapfile layer definition, but to no avail.
‘PROCESSING "LUT=1:1,156:156"’

Here is the layer definition:

    NAME tif_source
    DATA "/test.tif"

        wms_enable_request "*"
        wms_title "tif_source"

    # PROCESSING "SCALE_1=0,254"  ## does not produce the expected result
    # PROCESSING "LUT=1:1,156:156" ## does not work either

    DEBUG 4

How should I prevent MapServer from scaling the raster values during rendering?

One Answer

If you want to use data from a W*S then you should be using a WCS not a WMS. a WMS returns a picture of the data while a WCS returns the actual raster data.

MapServer supports WCS so it should be easy.

Answered by Ian Turton on January 6, 2022

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP