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

Support API Collections + bug fixes #59

Merged
merged 4 commits into from
Nov 16, 2020
Merged

Support API Collections + bug fixes #59

merged 4 commits into from
Nov 16, 2020

Conversation

m-mohr
Copy link
Collaborator

@m-mohr m-mohr commented Nov 13, 2020

A first attempt to implement better STAC API support. #48
This allows to show collections that have been referenced the OAFeat way (rel type data on landing page).
Some additional bug fixes sneaked in, see comments. May help a bit with #58?

Demo: https://stacindex.org/catalogs/google-earth-engine-openeo#/?t=collections

@m-mohr m-mohr requested a review from lossyrob November 13, 2020 13:26
src/migrate.js Show resolved Hide resolved
Copy link
Contributor

@lossyrob lossyrob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, looks great! One request - to use fetchUri instead of fetch, and one take-it-or-leave-it nitpick.

}

try {
const rsp = await fetch(externalCollections.href);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use fetchUri here? This allows the proxy functionality to work, and provides an abstraction if there's any other modifications to fetching we want to do in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I just copy pasted from externalItems below: https://github.com/radiantearth/stac-browser/pull/59/files#diff-fbae1f7e04ad34c70ca90231db3dd296764917ad88929a0860f4fe50e8627320R364

So I guess we should also change it there?

path: href,
to,
title: collection.title || collection.id || href,
url: this.resolve(href, this.url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider assigning this.resolve(href, this.url) to a const to use once (also used in definition of slug).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-mohr
Copy link
Collaborator Author

m-mohr commented Nov 16, 2020

@lossyrob Thank you, I addressed your issues. As they both originate from other places where I copied the code from, I also fixed it there.

@lossyrob lossyrob merged commit 17a5b9b into radiantearth:master Nov 16, 2020
@m-mohr m-mohr deleted the collections-api branch November 16, 2020 13:53
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

Successfully merging this pull request may close these issues.

2 participants