Skip to content

Commit

Permalink
Merge ea8303a into 306ceed
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Apr 13, 2023
2 parents 306ceed + ea8303a commit 6228a0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 38 deletions.
30 changes: 4 additions & 26 deletions owslib/iso.py
Expand Up @@ -747,35 +747,20 @@ def __init__(self, md=None):
self.specificationdate.append(val)


class SV_ServiceIdentification(object):
class SV_ServiceIdentification(MD_DataIdentification):
""" process SV_ServiceIdentification """
def __init__(self, md=None):

super().__init__(md, 'service')

if md is None:
self.title = None
self.abstract = None
self.contact = None
self.identtype = 'service'
self.type = None
self.version = None
self.fees = None
self.bbox = None
self.couplingtype = None
self.operations = []
self.operateson = []
else:
val = md.find(util.nspath_eval('gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString', namespaces))
self.title = util.testXMLValue(val)

val = md.find(util.nspath_eval('gmd:abstract/gco:CharacterString', namespaces))
self.abstract = util.testXMLValue(val)

self.contact = None
val = md.find(util.nspath_eval(
'gmd:citation/gmd:CI_Citation/gmd:citedResponsibleParty/gmd:CI_ResponsibleParty', namespaces))
if val is not None:
self.contact = CI_ResponsibleParty(val)

self.identtype = 'service'
val = md.find(util.nspath_eval('srv:serviceType/gco:LocalName', namespaces))
self.type = util.testXMLValue(val)

Expand All @@ -786,13 +771,6 @@ def __init__(self, md=None):
'srv:accessProperties/gmd:MD_StandardOrderProcess/gmd:fees/gco:CharacterString', namespaces))
self.fees = util.testXMLValue(val)

val = md.find(util.nspath_eval('srv:extent/gmd:EX_Extent', namespaces))

if val is not None:
self.bbox = EX_Extent(val)
else:
self.bbox = None

self.couplingtype = _testCodeListValue(md.find(util.nspath_eval(
'gmd:couplingType/gmd:SV_CouplingType', namespaces)))

Expand Down
24 changes: 12 additions & 12 deletions tests/doctests/iso_parse.txt
Expand Up @@ -3,7 +3,7 @@ Imports

>>> from tests.utils import resource_file
>>> from owslib.etree import etree
>>> from owslib.iso import MD_Metadata
>>> from owslib.iso import MD_Metadata

Print testing some metadata elements

Expand All @@ -15,14 +15,14 @@ Print testing some metadata elements
>>> x.identification[1].title
'Parameter-elevation Regressions on Independent Slopes Model Monthly Climate Data for the Continental United States. February 2013 Snapshot'

>>> x.identification[1].abstract[0:40]
'This dataset was created using the PRISM'
>>> x.identification[1].contact.name
'Christopher Daley'
>>> x.identification[1].contact.email
'daley@nacse.org'

>>> x.identification[1].operations[0]['connectpoint'][0].url
'http://cida.usgs.gov/thredds/dodsC/prism'
>>> x.identification[1].abstract[0:40]
'This dataset was created using the PRISM'

>>> x.contact[0].name
'Christopher Daley'

>>> x.contact[0].email
'daley@nacse.org'

>>> x.identification[1].operations[0]['connectpoint'][0].url
'http://cida.usgs.gov/thredds/dodsC/prism'

0 comments on commit 6228a0e

Please sign in to comment.