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

Update stac-browser to work with STAC 0.9 and 1.0.0-beta.1 #33

Conversation

lossyrob
Copy link
Contributor

@lossyrob lossyrob commented Jun 6, 2020

This PR updates stac-browser to work with 1.0.0-beta.1 and 0.9.0 STACs.

Changes of note:

  • Refactor the dictionary.json property map to a js function for comment-ability; split the group definitions (extensions and data providers) from the properties. Added property definitions for 1.0.0-beta.1 extensions so they show up on the side bar - some exceptions for objects that would require more complicated display logic.
  • Refactor validation logic - pull schemas directly from GitHub based on the STAC version of objects. Add a STAC_VERSION environment variable to default to in case STAC objects are older and do not have stac_version property.

Catalogs tested against:

Some catalogs had validation errors; I put in some workarounds to account for common mistakes, but in some cases the STACs will need to be corrected to work with the updated stac-browser.

In the case where external items are used with the context extension,
features are paged during fetch time. Therefore the number of items in
the 'items' collection is always less than the item page limit, so
it's necessary for the Vue table based paging to always 'stay' on page
1 to show the current item list.
This is useful if you want to test stac-browser against a STAC that
does not have the CORS permission to be used in stac-browser.

For example, with http-server installed from npm nad running

```
http-server -p 1111 --proxy https://geobase-spot-dev.s3.amazonaws.com/
--cors
```

to proxy the geobase STAC, and then running stac-browser with

```
CATALOG_URL=https://geobase-spot-dev.s3.amazonaws.com/catalog.json \
           STAC_PROXY_URL="https://geobase-spot-dev.s3.amazonaws.com|http://localhost:1111" \
           npm start
```

Allows for proper browsing of that STAC.
@lossyrob lossyrob force-pushed the feature/rde/work-with-current-stac-versions branch 2 times, most recently from 300a8fd to a9212a3 Compare June 6, 2020 03:05
@m-mohr
Copy link
Collaborator

m-mohr commented Jun 8, 2020

Wonderful! What are the common mistakes?

src/util.js Show resolved Hide resolved
src/util.js Outdated Show resolved Hide resolved
src/util.js Show resolved Hide resolved
@lossyrob
Copy link
Contributor Author

lossyrob commented Jun 8, 2020

@m-mohr the two that I accounted for were:

the spatial extent 'bbox' being a single array of coordinates instead of an array of arrays,
https://github.com/radiantearth/stac-browser/pull/33/files#diff-372429037ae0197375dd49ce425801e3R603

and provider roles being a single string instead of an array.
https://github.com/radiantearth/stac-browser/pull/33/files#diff-372429037ae0197375dd49ce425801e3R474

This updates the collection extent format to the 0.8 and above
specification. This also accounts for backwards compatibility, so
pre-0.8 STACs will still work.
This commit deletes the "dictionary.json" property map that exists,
and creates a `property.js` file that defines mappings between
property names and display information for use in the property bar. It
also adds properties and extenions for 1.0.0-beta.1.
@lossyrob lossyrob force-pushed the feature/rde/work-with-current-stac-versions branch from a9212a3 to 8ceada8 Compare June 12, 2020 22:34
This commit adds async schema validation that fetches schema based on
the stac version of the object being presented.
@lossyrob lossyrob force-pushed the feature/rde/work-with-current-stac-versions branch from 8ceada8 to de1eb52 Compare June 12, 2020 22:38
@lossyrob
Copy link
Contributor Author

Thank you for the review @m-mohr!

@lossyrob lossyrob merged commit 80488c1 into radiantearth:master Jun 12, 2020
@lossyrob lossyrob deleted the feature/rde/work-with-current-stac-versions branch April 19, 2023 21:29
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