Ticket #93 (defect)

Opened 2 years ago

Last modified 2 years ago

add keyword and contact detail metadata to capabilities

Status: closed (fixed)

Reported by: zool Assigned to: seang
Priority: minor Milestone:
Component: OWSLib Version:
Keywords: metadata Cc:

--- owslib/wms.py (revision 599) +++ owslib/wms.py (working copy) @@ -193,7 +193,13 @@

top = self._root.find('Capability/Layer') for elem in self._root.findall('Capability/Layer/Layer'):

self.contents.append(ContentMetadata(elem, top)) - + + # keywords + self.keywords = [f.text for f in self._root.findall('Service/KeywordList/Keyword')] + + # contact person + self.contact = ContactInformation(self._root.find('Service/ContactInformation')) +

def getContentByName(self, name):

"""Return a named content item.""" for item in self.contents: @@ -280,7 +286,22 @@

methods.append((verb.tag, {'url': url}))

self.methods = dict(methods) +class ContactInformation?: + """ Abstraction for contact details advertised in GetCapabilities? """ + def init(self,elem): + self.name = elem.find('ContactPersonPrimary/ContactPerson').text + self.organization = elem.find('ContactPersonPrimary/ContactOrganization').text + address = elem.find('ContactAddress') + if address is not None: + try: + self.address = address.find('Address').text + self.city = address.find('City').text + self.region = address.find('StateOrProvince') + self.postcode = address.find('Postcode') + self.country = address.find('Country') + except: pass+ email = elem.find('ContactElectronicMailAddress')

# Deprecated classes follow # TODO: remove

Attachments

wms.patch (1.6 kB) - added by zool on 12/19/06 16:23:26.

Change History

12/19/06 16:23:26: Modified by zool

  • attachment wms.patch added.

12/20/06 08:25:50: Modified by seang

  • status changed from new to closed.
  • resolution set to fixed.

Committed in r602. Thanks, Jo!