Discussion:
[Community] OWSLib bugfix for #215 (getCapabilities with nested Layers)
Ivan Boldyrev
2011-04-27 08:39:52 UTC
Permalink
http://trac.gispython.org/lab/ticket/215

It collects 'roots' of layers into owslib.wms.WebMapService's layers
attribute (there may be any number of such layers, so it is a list),
and each ContentMetadata has attribute children that stores list of
children.

Of course, there may be a better name than 'layers' for the
WebMapService attribute.

Code is also available at my GitHub repository, branch tree:
https://github.com/monoid/owslib/tree/tree

--
Ivan Boldyrev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: owslib-215.patch
Type: text/x-patch
Size: 1087 bytes
Desc: not available
URL: <http://lists.gispython.org/pipermail/community/attachments/20110427/d305b775/attachment.bin>
Dominic Lowe
2011-04-28 15:07:12 UTC
Permalink
Hi Ivan,

Many thanks for the patch. Do we need to introduce a new attribute
'layers' to solve this problem?
(given that we already have 'contents').

I know layers is the WMS term but we settled on contents as a
cross-service way of harmonising things in OWSLib so it would be good to
maintain that consistency (it's described in owslib/interfaces.py)

Regards

Dom
Post by Ivan Boldyrev
http://trac.gispython.org/lab/ticket/215
It collects 'roots' of layers into owslib.wms.WebMapService's layers
attribute (there may be any number of such layers, so it is a list),
and each ContentMetadata has attribute children that stores list of
children.
Of course, there may be a better name than 'layers' for the
WebMapService attribute.
https://github.com/monoid/owslib/tree/tree
--
Ivan Boldyrev
--
Scanned by iCritical.
Ivan Boldyrev
2011-04-29 05:39:19 UTC
Permalink
Post by Dominic Lowe
Hi Ivan,
Many thanks for the patch. ?Do we need to introduce a new attribute 'layers'
to solve this problem?
(given that we already have 'contents').
'contents' is a dictionary that maps names to layers (ContentMetadata
to be exact). 'layers' contains sequence of "root" layers. These
attributes have different structure, but both are useful for various
applications.

Perhaps, one can create object that is both dictionary and sequence
with some python magic.

If you keep 'layers' attribute, you might like to rename it to 'tree'
or 'layertree' or something like this.
Post by Dominic Lowe
I know layers is the WMS term but we settled on contents as a cross-service
way of harmonising things in OWSLib so it would be good to maintain that
consistency (it's described in owslib/interfaces.py)
Hm, interfaces.py states that contents is a sequence, but
WebMapService's 'contents' is a dict.

And I don't see definition of IServiceContent mentioned in contents'
description in interfaces.py

So I would like to know your recommendations as you know architecture
of OWSLib much better :)
Post by Dominic Lowe
Post by Ivan Boldyrev
http://trac.gispython.org/lab/ticket/215
It collects 'roots' of layers into owslib.wms.WebMapService's layers
attribute (there may be any number of such layers, so it is a list),
and each ContentMetadata has attribute children that stores list of
children.
Of course, there may be a better name than 'layers' for the
WebMapService attribute.
https://github.com/monoid/owslib/tree/tree
--
Ivan Boldyrev
--
Ivan Boldyrev
Loading...