TransWikia.com

Preventing scaling during raster rendering in MapServer

Geographic Information Systems Asked on March 12, 2021

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"’
or ‘PROCESSING "SCALE=0,254"’

Here is the layer definition:

LAYER
    NAME tif_source
    STATUS ON
    TYPE RASTER
    DATA "/test.tif"
    PROJECTION
        "init=epsg:32198"
    END

    METADATA
        wms_enable_request "*"
        wms_title "tif_source"
    END

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

    DEBUG 4
END

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 March 12, 2021

Add your own answers!

Ask a Question

Get help from others!

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