[Community] OWSLib - Access WMS attribution info

David Winslow dwinslow at opengeo.org
Fri Dec 4 20:45:39 EET 2009

On 12/03/2009 12:20 PM, David Winslow wrote:
> Hi all,
> For a project I'm working on, I'd like to access the Attribution field 
> on some layers in a WMS capabilities document.  I'd love to use OWSLib 
> (looks like it would be a lot easier to use than parsing the XML 
> directly), but when I try to retrieve the Attribution I just get an 
> empty string (or None if there is no attribution for the layer.)  I 
> was expecting an object with the title, logo URL, and link for the 
> Attribution.
> Digging into the code a bit I see that Attribution is parsed in 
> exactly the same way as Name and Title, so it will always be a 
> string.  Would it be reasonable to change this to an object or 
> dictionary with the fields I mentioned above?
> I would be happy to put together a patch if there's interest.
> -- 
> David Winslow
> OpenGeo - http://opengeo.org/
Ignoring some test failures, here is a patch for the attribution 
feature.  Attribution is presented like so:

 >>> wms['opengeo:poi'].attribution
'logo_size': (353, 112), 'logo_url': 
'title': 'GeoServer Sample Data'}

I am attaching the full patch.

David Winslow
OpenGeo - http://opengeo.org/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: attribution.patch
URL: <http://lists.gispython.org/pipermail/community/attachments/20091204/6fdf3616/attachment.txt>

More information about the Community mailing list