It is now possible to create a WMS server by implementing a handfull of interfaces and making a leightweight pylons app. Here's how.

  • Checkout ows_common from the ows_framework-refactor branch and make the egg live.
  • For your datasource/rendering system implement ows_common.service.wms_iface. This interface is documented  here. In this example we assume you have created a class MyLayerMapper.
  • Create a pylons application
  • Add the following to your paster configuration file:
    # ...
    # Set to pylons if you want WMS calls to be handled by the pylons debugger.  
    # Else WMS exceptions will be raised
    ows_server.exception_type = pylons
    # Point to the service-level OWS configuration file
    ows_server.capabilities_config = ./capabilities.conf
  • Create capabilities.conf something like
    title: OWS Pylons test server
    provider: British Atmospheric Data Centre
    site: Stephen Pascoe
  • Create a controller like this:
    # MyLayerMapper implements ows_common.service.wms_iface.ILayerMapper
    from mypackage import MyLayerMapper
    from ows_common.pylons.wms_controller import WMSController
    class MyWmsController(WMSController):
        layerMapper = MyLayerMapper()
  • Your done.

The pylons app will use MyLayerMapper to serve the WMS.