[GIS] How to serve a GeoTIFF file using WMS

geotiff-tiffmapserverwms

I want to display a GeoTIFF file which is a air pollution map by use of WMS. This GeoTIFF file is an output of WPS. The following is my mapfile and the URL request and the output. I use MapServer for Windows (MS4W).

MAP
    NAME PM10
    IMAGECOLOR 255 255 255
    SIZE 600 800
    IMAGETYPE PNG24 ## use AGG to for anti-aliasing
    OUTPUTFORMAT
        NAME 'AGG'
        DRIVER AGG/PNG
        MIMETYPE "image/png"
        IMAGEMODE RGB
        EXTENSION "png"
    END # outputformat
    PROJECTION
        "init=epsg:3035" #latlon on etrs 1989 laea
    END
    EXTENT 3487500 2297500 4402500 3202500 # meters extents of region2
    WEB
        IMAGEPATH "c:/tmp/ms_tmp/"
        IMAGEURL "/ms_tmp/"
        METADATA
            "ows_enable_request" "*"
            "map" "C:/ms4w/apps/airpollution/config.map"
            "ows_schemas_location" "http://schemas.opengeospatial.net"
            "ows_title" "Sample WMS"
            "ows_onlineresource" "http://localhost:7070/cgi-bin/mapserv.exe?map=C:/ms4w/apps/airpollution/config.map&"               
            "ows_srs" "EPSG:3035" #latlon      
            "wms_feature_info_mime_type" "text/plain"
            "wms_feature_info_mime_type" "text/html"
            "wms_server_version" "1.1.1"
            "wms_formatlist" "image/png,image/gif,image/jpeg, image/geotiff"
            "wms_format" "image/png"
        END #metadata
    END #web
    LAYER
        NAME "pm10"
        DATA "pm10.tif"
        TYPE RASTER
        STATUS ON
        METADATA
            "ows_title" "pollution"
        END #metadata
        PROJECTION
            "init=epsg:3035"
        END #projection
    END #layer pm10
END #map

I want the output format to be PNG.

This is the URL request I am trying:

http://localhost:7070/cgi-bin/mapserv.exe?map=C:/ms4w/apps/airpollution/config.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=pm10&STYLE=&SRS=EPSG:3035&BBOX=97,5,106,21&WIDTH=600&HEIGHT=800&FORMAT=image/png

What I get as a response is an empty white image.

What I want is an map like image which different values pixels displayed with different colors. I did the same thing by opening the same GeoTIFF file in ArcMap. I know that I have to classify the raster file by use of SLD, but I get error there that "Could not open SLD sld/sld.xml and save it in temporary file"

I want to be sure that the GeoTIFF file is accepted as an input data. The reason that I think it is not accepted is that when I change the name of GeoTIFF file to something else in .map file I still get the same output (white colored image).

Best Answer

You seem to have a problem with coordinate systems. The WMS request BBOX (&BBOX=97,5,106,21) seems to be given in latitude-longitude, but the coordinate system (&SRS=EPSG:3035) is, according to http://spatialreference.org/ref/epsg/3035/, "ETRS89 / ETRS-LAEA". So you need to specify the BBOX in that coordinate system. You could try to use the values that you have in your MAP EXTENT: 3487500 2297500 4402500 3202500 - they seem to be in the right range.

If your WMS server supports projections, you could also try to change the SRS in the WMS request to EPSG:4326.

Related Question