-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! |
owslib/catalogue/csw2.py
Outdated
@@ -578,6 +580,12 @@ def _parserecords(self, outputschema, esn): | |||
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.
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)?
There was a problem hiding this comment.
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.
owslib/catalogue/csw3.py
Outdated
@@ -477,6 +479,12 @@ def _parserecords(self, outputschema, esn): | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here.
owslib/feature/wfs100.py
Outdated
@@ -470,7 +471,11 @@ def parse_remote_metadata(self, timeout=30): | |||
if mdelem is not None: | |||
metadataUrl["metadata"] = MD_Metadata(mdelem) | |||
else: | |||
metadataUrl["metadata"] = None | |||
mdelem = MD_Metadata_3.find_start(doc) |
There was a problem hiding this comment.
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?
owslib/iso_3.py
Outdated
"xlink":"http://www.w3.org/1999/xlink" | ||
} | ||
|
||
class printable(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this function required?
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