image There a number of benefits to using a cascading WMS service – a WMS service that is read and then forwarded on through an intermediary WMS server:

  • you can cache the service (for example with TileCache) to greatly improve performance
  • your application need only worry about a single point of connection, using WMS layers aggregated from many different sources
  • you can add additional metadata missing from the source
  • services can be reprojected (using GDAL)
  • you can merge WMS layers together and server them out as a new map layer

There are also some negatives:

  • you have additional server configuration to set up and maintain
  • if you are not adding or changing the WMS service you should probably connect to the WMS service directly in the client applications, otherwise there will be a performance hit
  • caching may contravene the licensing agreement of the original WMS source

The rest of this post details the steps in setting up a cascading WMS using MapServer. You need MapServer 5.4.1 or higher to implement a secure cascaded WMS service. This example uses a 64-bit version of MapServer 5.6 taken from Tamas Szekeres’s autobuilds site installed in a C:\ms4w64 folder. It also assumes MapServer has been configured with SSL as detailed in another post. In this example I use IIS and Windows Server 2003.

imageMapServer makes use of libcurl.dll to connect to web resources. The reason I’ve had to learn this is because libcurl.dll is vital when using MapServer as a WMS client, or “a cascading WMS server” – using MapServer to connect to another WMS server and then “forward” them as if they were any other map layer.

libcurl.dll is the library version of the command line tool cURL – a tool written in C (hence the name) that:

is a command line tool for transferring data with URL syntax, supporting FTP, FTPS, HTTP, HTTPS…curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading…

..libcurl is most probably the most portable, most powerful and most often used C-based multi-platform file transfer library on this planet – be it open source or commercial. – http://curl.haxx.se/