-
Couldn't load subscription status.
- Fork 284
capture dct:spatial as bbox, if it contains a box #963
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
base: master
Are you sure you want to change the base?
Conversation
|
@pvgenuchten - great to get some tests for the CSW parsing. It looks like there is a lot of shared code in the A couple of questions:
|
|
@pvgenuchten - we're looking to make a new release of OWSLib. If you have any thoughts on the above questions, please add to this ticket. Are you then happy to merge? |
I'm not sure i'm able to manage the refactore, but for sure is a good idea. I'd say postpone to next PR.
valid question, I will have a look, maybe we can store both?
dct:spatial indeed is often populated with a spatial label, such as |
|
This Pull Request has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days. |
|
This Pull Request has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days. |
|
This Pull Request has been closed due to there being no activity for more than 90 days. |
| md_resource = get_md_resource('tests/resources/9250AA67-F3AC-6C12-0CB9-0662231AA181_dc2.xml') | ||
| md = CswRecord(md_resource) | ||
|
|
||
| assert type(md) is CswRecord |
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.
assert isinstance(CswRecord, md)| """ | ||
| namespaces = Namespaces().get_namespaces(keys=('dc', 'dct', 'ows', 'rdf', 'gml', 'csw')) | ||
|
|
||
| with io.open(file_path, mode='r', encoding='utf-8') as f: |
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 use open() instead of io.open?
| else: | ||
| self.bbox = None | ||
|
|
||
| val = record.find(util.nspath_eval('dct:spatial', namespaces)) |
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.
Suggest the below (also for owslib/catalogue/csw3.py):
val = record.find(util.nspath_eval('dct:spatial', namespaces))
self.spatial = None
if val is not None:
val = util.testXMLValue(val)
tokens = val.split(',')
if len(tokens) == 4:
self.bbox = ows.BoundingBox(None, namespaces['ows'])
self.bbox.minx = tokens[0]
self.bbox.miny = tokens[1]
self.bbox.maxx = tokens[2]
self.bbox.maxy = tokens[3]
else:
self.spatial = val
in some cases, bbox is strored in dct:spatial, nice to have it as bbox
added some csw parse tests, seemed not existing