#NEWLINE# def __init__( self , md = None , identtype = None ) : #NEWLINE# #INDENT# if ( md is None ) : #NEWLINE# #INDENT# self . identtype = None #NEWLINE# self . title = None #NEWLINE# self . alternatetitle = None #NEWLINE# self . aggregationinfo = None #NEWLINE# self . uricode = [ ] #NEWLINE# self . uricodespace = [ ] #NEWLINE# self . date = [ ] #NEWLINE# self . datetype = [ ] #NEWLINE# self . uselimitation = [ ] #NEWLINE# self . uselimitation_url = [ ] #NEWLINE# self . accessconstraints = [ ] #NEWLINE# self . classification = [ ] #NEWLINE# self . otherconstraints = [ ] #NEWLINE# self . securityconstraints = [ ] #NEWLINE# self . useconstraints = [ ] #NEWLINE# self . denominators = [ ] #NEWLINE# self . distance = [ ] #NEWLINE# self . uom = [ ] #NEWLINE# self . resourcelanguage = [ ] #NEWLINE# self . creator = [ ] #NEWLINE# self . publisher = [ ] #NEWLINE# self . contributor = [ ] #NEWLINE# self . edition = None #NEWLINE# self . abstract = None #NEWLINE# self . abstract_url = None #NEWLINE# self . purpose = None #NEWLINE# self . status = None #NEWLINE# self . contact = [ ] #NEWLINE# self . keywords = [ ] #NEWLINE# self . keywords2 = [ ] #NEWLINE# self . topiccategory = [ ] #NEWLINE# self . supplementalinformation = None #NEWLINE# self . extent = None #NEWLINE# self . bbox = None #NEWLINE# self . temporalextent_start = None #NEWLINE# self . temporalextent_end = None #NEWLINE# self . spatialrepresentationtype = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . identtype = identtype #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:citation/gmd:CI_Citation/gmd:title/gco:CharacterString' , namespaces ) ) #NEWLINE# self . title = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:citation/gmd:CI_Citation/gmd:alternateTitle/gco:CharacterString' , namespaces ) ) #NEWLINE# self . alternatetitle = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:aggregationInfo' , namespaces ) ) #NEWLINE# self . aggregationinfo = util . testXMLValue ( val ) #NEWLINE# self . uricode = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gco:CharacterString' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . uricode . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . uricodespace = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . uricodespace . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . date = [ ] #NEWLINE# self . datetype = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date' , namespaces ) ) : #NEWLINE# #INDENT# self . date . append ( CI_Date ( i ) ) #NEWLINE# #UNINDENT# self . uselimitation = [ ] #NEWLINE# self . uselimitation_url = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:resourceConstraints/gmd:MD_Constraints/gmd:useLimitation/gco:CharacterString' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . uselimitation . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# for i in md . findall ( util . nspath_eval ( 'gmd:resourceConstraints/gmd:MD_Constraints/gmd:useLimitation/gmx:Anchor' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# val1 = i . attrib . get ( util . nspath_eval ( 'xlink:href' , namespaces ) ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . uselimitation . append ( val ) #NEWLINE# self . uselimitation_url . append ( val1 ) #NEWLINE# #UNINDENT# #UNINDENT# self . accessconstraints = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints/gmd:MD_RestrictionCode' , namespaces ) ) : #NEWLINE# #INDENT# val = _testCodeListValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . accessconstraints . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . classification = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:accessConstraints/gmd:MD_ClassificationCode' , namespaces ) ) : #NEWLINE# #INDENT# val = _testCodeListValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . classification . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . otherconstraints = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gco:CharacterString' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . otherconstraints . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . securityconstraints = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:resourceConstraints/gmd:MD_SecurityConstraints/gmd:classification/gmd:MD_ClassificationCode' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . securityconstraints . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . useconstraints = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:useConstraints/gmd:MD_RestrictionCode' , namespaces ) ) : #NEWLINE# #INDENT# val = _testCodeListValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . useconstraints . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . denominators = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:spatialResolution/gmd:MD_Resolution/gmd:equivalentScale/gmd:MD_RepresentativeFraction/gmd:denominator/gco:Integer' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . denominators . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . distance = [ ] #NEWLINE# self . uom = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:spatialResolution/gmd:MD_Resolution/gmd:distance/gco:Distance' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . distance . append ( val ) #NEWLINE# #UNINDENT# self . uom . append ( i . get ( 'uom' ) ) #NEWLINE# #UNINDENT# self . resourcelanguage = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:language/gmd:LanguageCode' , namespaces ) ) : #NEWLINE# #INDENT# val = _testCodeListValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . resourcelanguage . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# self . creator = [ ] #NEWLINE# self . publisher = [ ] #NEWLINE# self . contributor = [ ] #NEWLINE# for val in md . findall ( util . nspath_eval ( 'gmd:pointOfContact/gmd:CI_ResponsibleParty' , namespaces ) ) : #NEWLINE# #INDENT# role = val . find ( util . nspath_eval ( 'gmd:role/gmd:CI_RoleCode' , namespaces ) ) #NEWLINE# if ( role is not None ) : #NEWLINE# #INDENT# clv = _testCodeListValue ( role ) #NEWLINE# rp = CI_ResponsibleParty ( val ) #NEWLINE# if ( clv == 'originator' ) : #NEWLINE# #INDENT# self . creator . append ( rp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( clv == 'publisher' ) : #NEWLINE# #INDENT# self . publisher . append ( rp ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( clv == 'author' ) : #NEWLINE# #INDENT# self . contributor . append ( rp ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# val = md . find ( util . nspath_eval ( 'gmd:edition/gco:CharacterString' , namespaces ) ) #NEWLINE# self . edition = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:abstract/gco:CharacterString' , namespaces ) ) #NEWLINE# self . abstract = util . testXMLValue ( val ) #NEWLINE# val = md . find ( util . nspath_eval ( 'gmd:abstract/gmx:Anchor' , namespaces ) ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . abstract = util . testXMLValue ( val ) #NEWLINE# self . abstract_url = val . attrib . get ( util . nspath_eval ( 'xlink:href' , namespaces ) ) #NEWLINE# #UNINDENT# val = md . find ( util . nspath_eval ( 'gmd:purpose/gco:CharacterString' , namespaces ) ) #NEWLINE# self . purpose = util . testXMLValue ( val ) #NEWLINE# self . status = _testCodeListValue ( md . find ( util . nspath_eval ( 'gmd:status/gmd:MD_ProgressCode' , namespaces ) ) ) #NEWLINE# self . contact = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:pointOfContact/gmd:CI_ResponsibleParty' , namespaces ) ) : #NEWLINE# #INDENT# o = CI_ResponsibleParty ( i ) #NEWLINE# self . contact . append ( o ) #NEWLINE# #UNINDENT# self . spatialrepresentationtype = [ ] #NEWLINE# for val in md . findall ( util . nspath_eval ( 'gmd:spatialRepresentationType/gmd:MD_SpatialRepresentationTypeCode' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLAttribute ( val , 'codeListValue' ) #NEWLINE# if val : #NEWLINE# #INDENT# self . spatialrepresentationtype . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# warnings . warn ( 'The .keywords and .keywords2 properties will merge into the .keywords property in the future, with .keywords becoming a list of MD_Keywords instances. This is currently implemented in .keywords2. Please see https://github.com/geopython/OWSLib/issues/301 for more information' , FutureWarning ) #NEWLINE# self . keywords = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:descriptiveKeywords' , namespaces ) ) : #NEWLINE# #INDENT# mdkw = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# mdkw [ 'type' ] = _testCodeListValue ( i . find ( util . nspath_eval ( 'gmd:MD_Keywords/gmd:type/gmd:MD_KeywordTypeCode' , namespaces ) ) ) #NEWLINE# mdkw [ 'thesaurus' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# val = i . find ( util . nspath_eval ( 'gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:title/gco:CharacterString' , namespaces ) ) #NEWLINE# mdkw [ 'thesaurus' ] [ 'title' ] = util . testXMLValue ( val ) #NEWLINE# val = i . find ( util . nspath_eval ( 'gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:date/gco:Date' , namespaces ) ) #NEWLINE# mdkw [ 'thesaurus' ] [ 'date' ] = util . testXMLValue ( o ) #NEWLINE# val = i . find ( util . nspath_eval ( 'gmd:MD_Keywords/gmd:thesaurusName/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode' , namespaces ) ) #NEWLINE# mdkw [ 'thesaurus' ] [ 'datetype' ] = util . testXMLValue ( val ) #NEWLINE# mdkw [ 'keywords' ] = [ ] #NEWLINE# for k in i . findall ( util . nspath_eval ( 'gmd:MD_Keywords/gmd:keyword' , namespaces ) ) : #NEWLINE# #INDENT# val = k . find ( util . nspath_eval ( 'gco:CharacterString' , namespaces ) ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# val2 = util . testXMLValue ( val ) #NEWLINE# if ( val2 is not None ) : #NEWLINE# #INDENT# mdkw [ 'keywords' ] . append ( val2 ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . keywords . append ( mdkw ) #NEWLINE# #UNINDENT# self . keywords2 = [ ] #NEWLINE# for mdkw in md . findall ( util . nspath_eval ( 'gmd:descriptiveKeywords/gmd:MD_Keywords' , namespaces ) ) : #NEWLINE# #INDENT# self . keywords2 . append ( MD_Keywords ( mdkw ) ) #NEWLINE# #UNINDENT# self . topiccategory = [ ] #NEWLINE# for i in md . findall ( util . nspath_eval ( 'gmd:topicCategory/gmd:MD_TopicCategoryCode' , namespaces ) ) : #NEWLINE# #INDENT# val = util . testXMLValue ( i ) #NEWLINE# if ( val is not None ) : #NEWLINE# #INDENT# self . topiccategory . append ( val ) #NEWLINE# #UNINDENT# #UNINDENT# val = md . find ( util . nspath_eval ( 'gmd:supplementalInformation/gco:CharacterString' , namespaces ) ) #NEWLINE# self . supplementalinformation = util . testXMLValue ( val ) #NEWLINE# val = None #NEWLINE# val2 = None #NEWLINE# val3 = None #NEWLINE# extents = md . findall ( util . nspath_eval ( 'gmd:extent' , namespaces ) ) #NEWLINE# extents . extend ( md . findall ( util . nspath_eval ( 'srv:extent' , namespaces ) ) ) #NEWLINE# for extent in extents : #NEWLINE# #INDENT# if ( val is None ) : #NEWLINE# #INDENT# for e in extent . findall ( util . nspath_eval ( 'gmd:EX_Extent/gmd:geographicElement' , namespaces ) ) : #NEWLINE# #INDENT# if ( ( e . find ( util . nspath_eval ( 'gmd:EX_GeographicBoundingBox' , namespaces ) ) is not None ) or ( e . find ( util . nspath_eval ( 'gmd:EX_BoundingPolygon' , namespaces ) ) is not None ) ) : #NEWLINE# #INDENT# val = e #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# self . extent = EX_Extent ( val ) #NEWLINE# self . bbox = self . extent . boundingBox #NEWLINE# #UNINDENT# if ( val2 is None ) : #NEWLINE# #INDENT# val2 = extent . find ( util . nspath_eval ( 'gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:beginPosition' , namespaces ) ) #NEWLINE# if ( val2 is None ) : #NEWLINE# #INDENT# val2 = extent . find ( util . nspath_eval ( 'gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml32:TimePeriod/gml32:beginPosition' , namespaces ) ) #NEWLINE# #UNINDENT# self . temporalextent_start = util . testXMLValue ( val2 ) #NEWLINE# #UNINDENT# if ( val3 is None ) : #NEWLINE# #INDENT# val3 = extent . find ( util . nspath_eval ( 'gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml:TimePeriod/gml:endPosition' , namespaces ) ) #NEWLINE# if ( val3 is None ) : #NEWLINE# #INDENT# val3 = extent . find ( util . nspath_eval ( 'gmd:EX_Extent/gmd:temporalElement/gmd:EX_TemporalExtent/gmd:extent/gml32:TimePeriod/gml32:endPosition' , namespaces ) ) #NEWLINE# #UNINDENT# self . temporalextent_end = util . testXMLValue ( val3 )