You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error message
=========
Could not parse "/tmp/metadata" as an XML record
Traceback (most recent call last):
File "/home/pycsw/pycsw/pycsw/core/admin.py", line 370, in load_records
record = metadata.parse_record(context, metadata_record, repo)
File "/home/pycsw/pycsw/pycsw/core/metadata.py", line 120, in parse_record
return _parse_metadata(context, repos, record)
File "/home/pycsw/pycsw/pycsw/core/metadata.py", line 135, in _parse_metadata
return [_parse_json_record(context, repos, record)]
File "/home/pycsw/pycsw/pycsw/core/metadata.py", line 1632, in _parse_json_record
recobj = _parse_stac_item(context, repos, record)
File "/home/pycsw/pycsw/pycsw/core/metadata.py", line 1751, in _parse_stac_item
_set(context, recobj, 'pycsw:BoundingBox', util.bbox2wktpolygon(util.geojson_geometry2bbox(record['geometry'])))
File "/home/pycsw/pycsw/pycsw/core/util.py", line 185, in geojson_geometry2bbox
geom_type = geometry.get('type')
AttributeError: 'NoneType' object has no attribute 'get'
Environment
operating system:
Python version:
pycsw version:
source/distribution
git clone
DebianGIS/UbuntuGIS
PyPI
zip/tar.gz
other (please specify): Docker (latest)
web server
Apache/mod_wsgi
CGI
other (please specify):
The text was updated successfully, but these errors were encountered:
Looking at the STAC Item spec, I am interpreting the inverse (if geometry is not null, bbox is required), so that bbox provides a simple minimum bounding geometry if geometry is defined.
Having said this, I've reproduced the error and applied a fix as part of #991.
* minor STAC API updates
* add tests for required link properties
* STAC API: add bbox is geometry is null (#847)
* safeguard null geometry handling on STAC parsing (#847)
* update geometry/bbox handling
Description
STAC Item spec says that geometry can be null and bbox is required if geometry is null.
https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md
Test with a copy of https://github.com/radiantearth/stac-spec/blob/master/examples/simple-item.json
with no bbox and "geometry": null, throws the following error:
Environment
The text was updated successfully, but these errors were encountered: