Capabilities of a W*S

OWSLib should behave more like Python's xmlrpclib.

from owslib.wms import WMS

# create a WMS proxy
wms = WMS(url='http://foo.com/wms', version='1.1.1')

OWS capabilities should be a member of the proxy object in the same way that xmlrpclib proxies have a "system" member. Question is whether capabilities should be

  • 1) a flat object, sort of like what we're currently doing
      layer_names = wms.capabilities.layernames()
    
  • 2) an infoset (ElementTree-style), the most "raw" option
      layer_names = [n.text for n in wms.capabilities.findall('Capability/Layer/Layer/Name')]
    
  • 3) a mapping:
      layer_names = [layer['name'] for layer in wms.capabilities['layers']]
    
  • or an object that contains other objects. A WMSLayerDescriptor class is implied here:
      layer_names = [layer.name for layer in wms.capabilities.layers]
    

Back to: