wiki:OwsFramework/WmsInterface

Version 2 (modified by spascoe, 11 years ago) (diff)

--

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:
    [DEFAULT]
    # ...
    
    # 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
    [serviceIdentification]
    title: OWS Pylons test server
    
    [serviceProvider]
    provider: British Atmospheric Data Centre
    site: http://badc.nerc.ac.uk
    contact.name: Stephen Pascoe
    contact.email: S.Pascoe@rl.ac.uk
    
  • 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.