[Community] OWSLib - Access WMS attribution info
dominic.lowe at stfc.ac.uk
dominic.lowe at stfc.ac.uk
Mon Dec 7 10:46:16 EET 2009
Hi David,
Many thanks for the patch. I will look into putting this into the trunk.
re: the tests - yes they are broken... I'd better look into that. Actually I think in most cases the servers have changed their responses and the tests not updated to match.
Cheers,
Dom
-----Original Message-----
From: community-bounces at lists.gispython.org on behalf of David Winslow
Sent: Fri 04/12/2009 18:45
To: community at lists.gispython.org
Subject: Re: [Community] OWSLib - Access WMS attribution info
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
{'url':
'http://svn.codehaus.org/geoserver/trunk/data/release/data/',
'logo_size': (353, 112), 'logo_url':
'http://geoserver.org/s/1518/25/0.1/_/download/resources/com.atlassian.confluence.themes.geoserver%3Ageoserver/chrome/geoserver-logo.png',
'title': 'GeoServer Sample Data'}
I am attaching the full patch.
--
David Winslow
OpenGeo - http://opengeo.org/
--
Scanned by iCritical.
More information about the Community
mailing list