-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
The current ItemSerializer.stac_to_db
does not write any non inferred links to the links field in the items table.
We propose :
An adjustment to filter for derived_from
in the input and then explicitly set the links value
# Proposed mod to stac_fastapi/sqlalchemy/serializers.ItemSerializer.py
from stac_fastapi.types.links import filter_links
# ...
class ItemSerializer(Serialiazer):
# ...
@classmethod
def stac_to_db(...):
# ...
# Before instantiation of the database.Item, pull out derived_from link
derived_from = None
# Remove inferred link
temp_links = filter_links(stac_data['links'])
# Assign derived_from link
for temp_link in temp_links:
if temp_link['rel'] == 'derived_from':
derived_from = [temp_link]
break
# ...
return database.Item(
# ...
links=derived_from,
# ...
)
We would be happy to provide a PR.
Thanks
Metadata
Metadata
Assignees
Labels
No labels