Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pycsw/core/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1834,6 +1834,7 @@ def _parse_stac_resource(context, repos, record):
_set(context, recobj, 'pycsw:CreationDate', record['properties'].get('created'))
_set(context, recobj, 'pycsw:Modified', record['properties'].get('updated'))
_set(context, recobj, 'pycsw:Platform', record['properties'].get('platform'))
_set(context, recobj, 'pycsw:OtherConstraints', record['properties'].get('license'))
instruments = record['properties'].get('instruments')
if instruments is not None:
_set(context, recobj, 'pycsw:Instrument', ','.join(instruments))
Expand All @@ -1853,6 +1854,7 @@ def _parse_stac_resource(context, repos, record):
_set(context, recobj, 'pycsw:CreationDate', record.get('created'))
_set(context, recobj, 'pycsw:Modified', record.get('updated'))
_set(context, recobj, 'pycsw:Platform', record.get('platform'))
_set(context, recobj, 'pycsw:OtherConstraints', record.get('license'))
instruments = record.get('instruments')
if instruments is not None:
_set(context, recobj, 'pycsw:Instrument', ','.join(instruments))
Expand All @@ -1876,6 +1878,7 @@ def _parse_stac_resource(context, repos, record):
_set(context, recobj, 'pycsw:CreationDate', record.get('created'))
_set(context, recobj, 'pycsw:Modified', record.get('updated'))
_set(context, recobj, 'pycsw:Platform', record.get('platform'))
_set(context, recobj, 'pycsw:OtherConstraints', record.get('license'))
instruments = record.get('instruments')
if instruments is not None:
_set(context, recobj, 'pycsw:Instrument', ','.join(instruments))
Expand Down
3 changes: 2 additions & 1 deletion pycsw/core/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ def __init__(self, database, context, app_root=None, table='records', repo_filte
'instrument': self.dataset.instrument,
'sensortype': self.dataset.sensortype,
'off_nadir': self.dataset.illuminationelevationangle,
'distancevalue': self.dataset.distancevalue
'distancevalue': self.dataset.distancevalue,
'otherconstraints': self.dataset.otherconstraints
}

if self.dbtype == 'postgresql':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_queryables(config):
assert content['$id'] == 'http://localhost/pycsw/oarec/collections/metadata:main/queryables' # noqa
assert content['$schema'] == 'http://json-schema.org/draft/2019-09/schema'

assert len(content['properties']) == 18
assert len(content['properties']) == 19

assert 'geometry' in content['properties']
assert content['properties']['geometry']['$ref'] == 'https://geojson.org/schema/Polygon.json' # noqa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_queryables(config_virtual_collections):
assert content['$id'] == 'http://localhost/pycsw/oarec/collections/metadata:main/queryables' # noqa
assert content['$schema'] == 'http://json-schema.org/draft/2019-09/schema'

assert len(content['properties']) == 18
assert len(content['properties']) == 19

assert 'geometry' in content['properties']
assert content['properties']['geometry']['$ref'] == 'https://geojson.org/schema/Polygon.json' # noqa
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@
},
"collection": "sentinel-2-l2a",
"properties": {
"license": "other",
"datetime": "2024-11-28T09:23:31.024000Z",
"platform": "Sentinel-2A",
"proj:epsg": 32634,
Expand Down Expand Up @@ -730,4 +731,4 @@
"https://stac-extensions.github.io/projection/v1.0.0/schema.json"
],
"stac_version": "1.0.0"
}
}
Binary file modified tests/functionaltests/suites/stac_api/data/records.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Authors: Tom Kralidis <tomkralidis@gmail.com>
# Angelos Tzotsos <gcpp.kalxas@gmail.com>
#
# Copyright (c) 2025 Tom Kralidis
# Copyright (c) 2026 Tom Kralidis
# Copyright (c) 2022 Angelos Tzotsos
#
# Permission is hereby granted, free of charge, to any person
Expand Down Expand Up @@ -134,7 +134,7 @@ def test_queryables(config):
assert content['$id'] == 'http://localhost/pycsw/oarec/stac/collections/metadata:main/queryables' # noqa
assert content['$schema'] == 'http://json-schema.org/draft/2019-09/schema'

assert len(content['properties']) == 18
assert len(content['properties']) == 19

assert 'geometry' in content['properties']
assert content['properties']['geometry']['$ref'] == 'https://geojson.org/schema/Polygon.json' # noqa
Expand Down Expand Up @@ -191,6 +191,11 @@ def test_items(config):
assert content['numberMatched'] == 26
assert content['features'][6]['properties']['title'] == 'S2B_MSIL1C_20190910T095029_N0208_R079_T33UWQ_20190910T120910.SAFE' # noqa

content = json.loads(api.items({}, None, {'otherconstraints': 'other'})[2])

assert content['numberMatched'] == 1
assert content['features'][0]['properties']['license'] == 'other'

content = json.loads(api.items({}, None, {'sortby': '-title'})[2])

assert content['numberMatched'] == 26
Expand Down