A not well documented Mapserver feature for Hillshade

If you have a hillshade GRID(or exported tiff) and DEM you can build a nice color hillshape map with Mapserver...  It's not really simple and well documented, but it's possible. I think this trick was add in Mapserver in 'experimental' mode in the trunk and gets released, but never realy discuss in the mailling list Mapserver-dev. To build this kind of service, we must have a DEM and Hillshade. It's not necessary to have a GRID format for this trick. A simple black and white tif format is fine. First you must know the pixel range to process in your DEM. You need it to let GDAL reader a pre-scale from incoming raster data to get the pixel range to process. You can easely use the gdalinfo utilities. ... Upper Left (-1051654.551, 2174097.741) ( 88d52'54.70"W, 62d14'24.12"N) Lower Left (-1051654.551, -201102.259) ( 80d59'1.05"W, 41d23'0.63"N) Upper Right ( 1359945.449, 2174097.741) ( 42d36'0.34"W, 61d21'52.09"N) Lower Right ( 1359945.449, -201102.259) ( 52d27'53.73"W, 40d50'27.53"N) Center ( 154145.449, 986497.741) ( 66d11'34.47"W, 52d52'40.66"N) Band 1 Block=256x256 Type=Int16, ColorInterp=Gray Min=-10.000 Max=706.000 Minimum=-32768.000, Maximum=1890.000, Mean=-185.108, StdDev=3252.745 ... In the example I have in Band 1, a min elevation of -10 to a max of 706. This resulte in the mapfile with PROCESSING "SCALE=-10,706". Then, you have to process the DEM dynamically with a COLORRANGE in TRANSPARENCY mode and overlay it on a hillshade. To get the DEM and the process hillshade in a single layer in your map, simply GROUP them in your mapfile. Example in the mapfile GROUP on "Ombrage_bleu_250K"...

...
LAYER
    NAME "ombre250k_blue"
    GROUP "Ombrage_blue_250K"
    DATA "mne250k/ombre250k.tif"
    TYPE RASTER
    MAXSCALE 4000000
    MINSCALE 1
    METADATA
        "wms_group_title"       "Ombrage blue 250K"
        "wms_name"              "ombre250k_blue"
        "wms_title"             "ombre250k blue"
        INCLUDE                 "../include/ec/ec_meta_layer.map"
    END
    PROJECTION
         "init=epsg:32198"
    END
END
LAYER
    NAME "mne250k_blue"
    GROUP "Ombrage_blue_250K"
    DATA "mne250k/mne250k.tif"
    TRANSPARENCY 30
    TYPE RASTER
    PROCESSING "SCALE=-1,706"
    METADATA
        "wms_group_title"       "Ombrage bblue 250K"
        "wms_name"              "mne250k_blue"
        "wms_title"             "mne250k blue"
        INCLUDE                 "../include/ec/ec_meta_layer.map"
    END
    PROJECTION
        "init=epsg:32198"
    END
    CLASS
        STYLE
            COLORRANGE 255 255 255   0 0 255
            DATARANGE -1 706
        END
    END
END
...
End the getMap query, use the group layer name "Ombrage_bleu_250K"... http://your.server.com/cgi-bin/mapserv?map=demshade&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=Ombrage_bleu_250K&STYLES=&FORMAT=image/png&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&SRS=EPSG:32198&BBOX=87557.4046920096,498799.484254657,182346.544021857,583840.349445035&WIDTH=739&HEIGHT=663 In next example, I have tree layer that I can call with the GROUP tag "HILLSHAPE_GREEN_BLUE". First I add the hillshape in background. Then I overlay two MNE rasters layers that show elevation from -63 to 1280. So I coloring for the first -63 to 500 metre elevation with a green to blue colo rampe, and from 300 to 1280 with a blue to green color rampe. Not that all thos layer are add in the mapfile as Arc/INFO GRID TILEINDEX.

LAYER
    NAME  "Ombre_vert_bleu"
    GROUP  "HILLSHAPE_GREEN_BLUE"
    TYPE  RASTER
    TILEINDEX  "mneomb20k/omb"
    TILEITEM  "location"
    MAXSCALE  200000
    MINSCALE  1
    METADATA
        "wms_group_title"    "Ombrage  vert  bleu  20K"
        "wms_name"           "Ombre_vert_bleu"
        INCLUDE              "../include/ec/ec_meta_layer.map"
        "wms_title"          "Ombre"
    END
    PROJECTION
        "init=epsg:32198"
    END
END
  #-------------------------
LAYER
    NAME  "MNE_comp_green_blue"
    GROUP  "HILLSHAPE_GREEN_BLUE"
    TILEINDEX  "mneomb20k/mne"
    TILEITEM  "location"
    TRANSPARENCY  40
    TYPE  RASTER
    PROCESSING  "SCALE=-63,500"
    MAXSCALE  200000
    MINSCALE  1
    METADATA
        "wms_name"         "MNE_comp_green_blue"
        INCLUDE            "../include/ec/ec_meta_layer.map"
        "wms_title"        "MNE  comp  green"
    END
    PROJECTION
            "init=epsg:32198"
    END
    CLASS
        STYLE
            COLORRANGE  34  139  34  255  255  255
            DATARANGE  -63  500
        END
    END
END
#--
LAYER
    NAME  "MNE_comp_blue_green"
    GROUP  "HILLSHAPE_GREEN_BLUE"
    TILEINDEX  "mneomb20k/mne"
    TILEITEM  "location"
    TRANSPARENCY  40
    TYPE  RASTER
    PROCESSING  "SCALE=300,1280"
    MAXSCALE  200000
    MINSCALE  1
    METADATA
        "wms_name"      "MNE_comp_blue_green"
        INCLUDE         "../include/ec/ec_meta_layer.map"
        "wms_title"     "MNE  comp  bleu"
    END
    PROJECTION
        "init=epsg:32198"
    END
    CLASS
        STYLE
            COLORRANGE  255  255  255  0  0  205
            DATARANGE  300  1280
        END
    END
END

The result of this combination show here Hillshade green-blue