Skip to content

Add support for ISO 19115 Part 3 XML#900

Merged
tomkralidis merged 17 commits into
geopython:masterfrom
vjf:ISO19115-3-part1
Mar 23, 2024
Merged

Add support for ISO 19115 Part 3 XML#900
tomkralidis merged 17 commits into
geopython:masterfrom
vjf:ISO19115-3-part1

Conversation

@vjf
Copy link
Copy Markdown
Contributor

@vjf vjf commented Jan 8, 2024

This pull request enables OWSLib to parse ISO 19115 Part 3 XML output.
e.g. parse Metadata URL output in GetCapabilities responses and parse CSW GetRecords repsonses

Also fixed bugs in metadataURL tests. (tests/test_remote_metadata.py) The patch code for 'openURL' was not being called, 'Offline' tests were still calling on live external services.

Once this PR has been merged and a new version of OWSLib is built, geopython/pycsw#933 can be updated and merged

vjf added 15 commits January 2, 2024 11:58
- Added ArcGIS synthetic sample
- Added tests for DQ_DataQuality, MD_FeatureCatalogueDescription and MD_Bands
- Ability to parse older mdb v1.0 XML
- Some 'Offline' tests were still calling on external services, monkeypatch of 'OpenURL' not working
- Fixed up monkeypatch of 'OpenURL' calls
- Added function to detect outer tag for iso_3.py
- Added code to utilise iso_3 in WFS/WMS GetCapabilities responses
- Added ISO 19115 Part 3 XML tests using pytest parameters
@coveralls
Copy link
Copy Markdown

coveralls commented Jan 8, 2024

Coverage Status

coverage: 60.786% (+1.2%) from 59.578%
when pulling 4cb7cb5 on vjf:ISO19115-3-part1
into bdc4033 on geopython:master.

Comment thread tests/test_iso3_parsing.py Outdated
@kalxas
Copy link
Copy Markdown
Member

kalxas commented Feb 26, 2024

Thank you @vjf for this valuable contribution!

Comment thread owslib/catalogue/csw2.py Outdated
Comment thread owslib/catalogue/csw2.py Outdated
val = i.find(util.nspath_eval('gm03:fileIdentifier', namespaces))
identifier = self._setidentifierkey(util.testXMLValue(val))
self.records[identifier] = GM03(i)
elif MD_Metadata_3.handles(outputschema): # ISO 19115 Part 3 XML
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we follow the same pattern (check for root namespace)?

Copy link
Copy Markdown
Contributor Author

@vjf vjf Mar 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does check the root namespace, only I have put this function inside the class.
For ISO19115p3, in order to support both ESRI and geoserver, unlike all the other schema types there are two versions of the set of namespaces.
Rather than add more complicated code to csw2.py, csw3.py etc., I decided that the best place for this detection logic was inside the class.
I thought it would be more portable and maintainable to have it in there rather than outside the class.

Comment thread owslib/catalogue/csw3.py Outdated
val = i.find(util.nspath_eval('gm03:fileIdentifier', namespaces))
identifier = self._setidentifierkey(util.testXMLValue(val))
self.records[identifier] = GM03(i)
elif MD_Metadata_3.handles(outputschema): # ISO 19115 Part 3 XML
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here.

Comment thread owslib/feature/wfs100.py Outdated
metadataUrl["metadata"] = MD_Metadata(mdelem)
else:
metadataUrl["metadata"] = None
mdelem = MD_Metadata_3.find_start(doc)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check the root namespace here to decipher between the two ISO versions?

Comment thread owslib/iso_3.py
"xlink":"http://www.w3.org/1999/xlink"
}

class printable():
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function required?

@tomkralidis tomkralidis merged commit cdcfce7 into geopython:master Mar 23, 2024
@tomkralidis
Copy link
Copy Markdown
Member

Thanks @vjf for this valuable contribution!

@vjf
Copy link
Copy Markdown
Contributor Author

vjf commented Mar 24, 2024

@tomkralidis @kalxas Thanks!

@vjf vjf deleted the ISO19115-3-part1 branch March 24, 2024 23:42
@jmckenna
Copy link
Copy Markdown
Member

seconded, thank-you @vjf !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants