Skip to content

Commit d817969

Browse files
authored
Merge pull request #844 from pvgenuchten/iso19139-otherconstraint-as-anchor
enables gmx:anchor for otherconstraints
2 parents a713c62 + effa03c commit d817969

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

owslib/iso.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,15 @@ def __init__(self, md=None, identtype=None):
502502
val = util.testXMLValue(i)
503503
if val is not None:
504504
self.otherconstraints.append(val)
505+
for i in md.findall(util.nspath_eval(
506+
'gmd:resourceConstraints/gmd:MD_LegalConstraints/gmd:otherConstraints/gmx:Anchor',
507+
namespaces)):
508+
val = util.testXMLAttribute(i, util.nspath('href', namespaces["xlink"]))
509+
if val is None:
510+
val = util.testXMLValue(i)
511+
if val is not None:
512+
self.otherconstraints.append(val)
513+
505514

506515
self.securityconstraints = []
507516
for i in md.findall(util.nspath_eval(

tests/resources/csw_dov_getrecordbyid.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<csw:GetRecordByIdResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2">
3-
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:geonet="http://www.fao.org/geonetwork" xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd">
3+
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:gmx="http://www.isotc211.org/2005/gmx" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:geonet="http://www.fao.org/geonetwork" xsi:schemaLocation="http://www.isotc211.org/2005/gmd http://www.isotc211.org/2005/gmd/gmd.xsd">
44
<gmd:fileIdentifier>
55
<gco:CharacterString>6c39d716-aecc-4fbc-bac8-4f05a49a78d5</gco:CharacterString>
66
</gmd:fileIdentifier>
@@ -470,6 +470,9 @@
470470
<gmd:otherConstraints>
471471
<gco:CharacterString>Data beschikbaar voor hergebruik volgens de Modellicentie Gratis Hergebruik. Toelichting beschikbaar op https://www.dov.vlaanderen.be/page/gebruiksvoorwaarden-dov-services</gco:CharacterString>
472472
</gmd:otherConstraints>
473+
<gmd:otherConstraints>
474+
<gmx:Anchor xlink:href="https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply">Geen beperkingen</gmx:Anchor>
475+
</gmd:otherConstraints>
473476
</gmd:MD_LegalConstraints>
474477
</gmd:resourceConstraints>
475478
<gmd:resourceConstraints>
@@ -841,4 +844,3 @@
841844
</gmd:dataQualityInfo>
842845
</gmd:MD_Metadata>
843846
</csw:GetRecordByIdResponse>
844-

tests/test_iso_parsing.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def test_md_parsing_dov():
137137

138138
assert_list(iden.classification, 0)
139139

140-
assert_list(iden.otherconstraints, 1)
140+
assert_list(iden.otherconstraints, 2)
141+
assert iden.otherconstraints[
142+
1] == "https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply"
141143
assert iden.otherconstraints[
142144
0] == "Data beschikbaar voor hergebruik volgens de " \
143145
"Modellicentie Gratis Hergebruik. Toelichting " \

0 commit comments

Comments
 (0)