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!

Related Questions

Exporting points according to a route I made

1  Asked on February 17, 2021 by byron


GeoServer raster isoline style

2  Asked on February 17, 2021


QGIS 3.4 Not Exporting Map to JPEG, JPG, PNG, PDF

1  Asked on February 17, 2021 by ashley-lynn-tarver


PostGIS install not completing

0  Asked on February 17, 2021 by jerome


Sending a WFS-T request

1  Asked on February 17, 2021 by ido-h-levi


Accessing single scene image file in Google Earth Engine

1  Asked on February 17, 2021 by iqbalhabibie-habibie


GEE, How to Remove Vertex Pixels

0  Asked on February 17, 2021 by user175279


Issue using pyModis.createMosaicGDAL() on Debian

1  Asked on February 17, 2021 by nart-barileva


“Display Background value “0” raster”

1  Asked on February 17, 2021 by vibin


Showing Count of Features by Attribute in Arcade Popup

0  Asked on February 17, 2021 by link-maxwell


Ask a Question

Get help from others!

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