Skip to content
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

Links dropped from STAC Item #192

Open
geospatial-jeff opened this issue Aug 20, 2019 · 3 comments
Open

Links dropped from STAC Item #192

geospatial-jeff opened this issue Aug 20, 2019 · 3 comments

Comments

@geospatial-jeff
Copy link

geospatial-jeff commented Aug 20, 2019

Sat-api currently drops all links (stac_item.links) when ingesting stac items. The bug is happening here.

const links = data.links.filter((link) => hlinks.includes(link))

The fix is filtering by rel:

const links = data.links.filter((link) => links.includes(link.rel))

@sharkinsspatial
Copy link
Contributor

@geospatial-jeff This behavior is by design. When we ingest an item we strip its referential links out so they can later be reconstructed dynamically when it is served through the API. This way it is served with links which reference the APIs deployed url. The link reconstruction happens here when an item is served. Some of the rationale for this approach is described in this discussion.

@matthewhanson
Copy link
Member

Hey @geospatial-jeff , as @sharkinsspatial said, the behavior of removing links is by design....but in re-reading your issue it looks like there is a bug and it is in fact removing all links because it's filtering by href which is an object and it's checking it against the list of string values: 'self', 'root', 'parent', 'child', 'collection', 'item', rather than link.rel.

Thanks for pointing it out, easy enough fix, I'll get it in the 0.3 branch

@sharkinsspatial
Copy link
Contributor

@geospatial-jeff It looks like we may have several issues like this on ingestion side. Thanks for flagging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants