Add support for ISO 19115 Part 3 XML#900
Conversation
- 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
|
Thank you @vjf for this valuable contribution! |
| 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 |
There was a problem hiding this comment.
Can we follow the same pattern (check for root namespace)?
There was a problem hiding this comment.
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.
| 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 |
| metadataUrl["metadata"] = MD_Metadata(mdelem) | ||
| else: | ||
| metadataUrl["metadata"] = None | ||
| mdelem = MD_Metadata_3.find_start(doc) |
There was a problem hiding this comment.
Can we check the root namespace here to decipher between the two ISO versions?
| "xlink":"http://www.w3.org/1999/xlink" | ||
| } | ||
|
|
||
| class printable(): |
|
Thanks @vjf for this valuable contribution! |
|
@tomkralidis @kalxas Thanks! |
|
seconded, thank-you @vjf ! |
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