This post details how the WMS GetCapabilities request can be used to create an automated report listing all the map layers available from a WMS server. The final sample page can be seen here.

The GetCapabilities Request

Web Mapping Services (WMS) is an open standard that all major GIS vendors implement in their server software (for example see the ESRI documentation). As a result applications built on these services are able to easily switch from one software package to another – allowing separation of code that allows for easier maintenance and reuse.

The GetCapabilities is one of three requests in the WMS specification. It “returns service-level metadata, which is a description of the service’s information content and acceptable request parameters.”

After eventually being able to see the results of a GetCapabilities request my aim was to generate a report listing the available map layers, and to check I had enetered all the required metadata. I had a look on the web to see if there were any stylesheets that would nicely format the data.

Continue reading »

Jan 162010

Yes, I’d like to see the map layers and capabilities available from my MapServer MAP file, and no I don’t want to download mapserv.exe..

Messing with Headers

I had the same problem with both Firefox and Internet Explorer 7 each time I issues a request such as:

http://localhost/cgi-bin/mapserv.exe?map=/ms4w/apps/my.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities

The browser tried to download mapserv.exe. The “exe” did actually contain the GetCapabilities XML, but it is very annoying to have to manually open it in another program each time.

This is a FAQ on the MapServer site which suggested that a program needs to be manually associated with the MIME type returned by the requests – application/vnd.ogc.wms_xml.

Continue reading »