WMS cascading with MapServer.

Posted by – Saturday 2012-06-30

MapServer supports WMS cascading. Recently I have used this feature to serve an ortophoto layer which was already being served from an old WMS service. This feature has allowed me to avoid copying the ortophoto to the new server. Given that orthopotos usually demand lots of hard disk space – even when they are compressed in formats like ECW or MrSID -, I have saved time and storage capacity.

Cascading WMS is easy with MapServer. Just edit the mapfile and add a new layer like the one shown below:

LAYER
        NAME            "ortophoto"

        EXTENT          580000 4688000 680000 4850000

        PROJECTION      
                "init=epsg:23029"
        END # end of object "projection"

        TYPE            RASTER

        CONNECTION      "http://my-sdi.net/wms?"
        CONNECTIONTYPE  WMS

        STATUS          OFF

        DUMP            FALSE

        METADATA
                "wms_name"              "ortophoto"
                "wms_format"            "image/jpeg"
                "wms_server_version"    "1.0.0"

                "wms_title"             "ortophoto"
                "wms_srs"               "epsg:23029"
                "wms_extent"            "580000 4688000 680000 4850000"
                "wms_abstract"          "PNOA ortophoto, year 2008"
                "wms_version"           "1.1.1"

                "queryable"             "false"
        END # end of metadata object
END # end of layer "ortofoto"

Compared to a non cascaded layer, perhaps the most notable differences this configuration snippet show are the parameters CONNECTION and CONNECTIONTYPE. The former contains the URL of the WMS service from which the data is fetched, and the latter indicates the type of connection. Besides the remote WMS service URL and the connection type, more parameters are required. From the MapServer’s WMS client page:

  • “wms_format” metadata – the image format to use in GetMap requests.
  • “wms_name” metadata – comma-separated list of layers to be fetched from the remote WMS server. This value is used to set the LAYERS and QUERY_LAYERS WMS URL parameters.
  • “wms_server_version” metadata – the version of the WMS protocol supported by the remote WMS server and that will be used for issuing GetMap requests.
  • “wms_srs” metadata – space-delimited list of EPSG projection codes supported by the remote server. You normally get this from the server’s capabilities output. This value should be upper case (EPSG:4326…..not epsg:4326) to avoid problems with case sensitive platforms. The value is used to set the SRS WMS URL parameter.
0 Comments on WMS cascading with MapServer.

Respond

Respond

Comments

Comments