Giter VIP home page Giter VIP logo

stac-browser's Introduction

STAC Browser

This is a Spatio-Temporal Asset Catalog (STAC) browser for static catalogs. Minimal support for APIs is implemented, but it not the focus of the Browser and may lead to issues. It attempts to surface all included data in a user-centric way (an approach which can inform how data is represented in the evolving spec). It is implemented as a single page application (SPA) for ease of development and to limit the overall number of catalog reads necessary when browsing (as catalogs may be nested and do not necessarily contain references to their parents).

Version: 3.2.0 (supports all STAC versions between 0.6.0 and 1.0.0)

This package has also been published to npm as @radiantearth/stac-browser.

It's not officially supported, but you may also be able to use it for certain OGC API - Records and OGC API - Features compliant servers.

Please note that STAC Browser is currently without funding for both maintenance, bug fixes and improvements. This means issues and PRs may be addressed very slowly. If you care about STAC Browser and have some funds to support the future of STAC Browser, please contact [email protected]

Table of Contents:

Examples

A demo instance is running at https://radiantearth.github.io/stac-browser/.

The catalog section of STAC Index is also built on top of STAC Browser (currently v2).

Get Started

First, you need to clone or download this repository.

Then switch into the newly created folder and install all dependencies:

npm install

By default, STAC Browser will let you browse all catalogs on STAC Index.

To browse only your own static STAC catalog or STAC API, set the catalogUrl CLI parameter when running the dev server. In this example we point to EarthSearch (https://earth-search.aws.element84.com/v1/):

npm start -- --open --catalogUrl="https://earth-search.aws.element84.com/v1/"

To open a local file on your system, see the chapter Using Local Files.

If you'd like to publish the STAC Browser instance use the following command:

npm run build -- --catalogUrl="https://earth-search.aws.element84.com/v1/"

This will only work on the root path of your domain though. If you'd like to publish in a sub-folder, you can use the pathPrefix option.

After building, dist/ will contain all assets necessary host the browser. These can be manually copied to your web host of choice. Important: If historyMode is set to history (which is the default value), you'll need to add an additional configuration file for URL rewriting. Please see the historyMode option for details.

You can customize STAC Browser, too. See the options and theming details below. If not stated otherwise, all options can either be specified via CLI, ENV variables or in the config file. You can also provide configuration options "at runtime" (after the build).

Private query parameters

experimental

STAC Browser supports "private query parameters", e.g. for passing an API key through. Any query parameter that is starting with a ~ will be stored internally, removed from the URL and be appended to STAC requests. This is useful for token-based authentication via query parameters.

So for example if your API requires to pass a token via the API_KEY query parameter, you can request STAC Browser as such: https://examples.com/stac-browser/?~API_KEY=123 which will change the URL to https://examples.com/stac-browser/ and store the token 123 internally. The request then will have the query parameter attached and the Browser will request e.g. https://examples.com/stac-api/?API_KEY=123.

Please note: If the server hosting STAC Browser should not get aware of private query parameters and you are having historyMode set to "history", you can also append the private query parameters to the hash so that it doesn't get transmitted to the server hosting STAC Browser. In this case use for example https://examples.com/stac-browser/#?~API_KEY=123 instead of https://examples.com/stac-browser/?~API_KEY=123.

Migrate from old versions

Please read the migration documentation for details.

Customize

Options

STAC Browser supports customization through a long list of options that can be set in various ways.

Please read the documentation for the options.

Languages

STAC Browser can be translated into other languages and can localize number formats, date formats etc.

You need to change the locale and supportedLocales settings to select the default language and the languages available to users.

The following languages are currently supported:

  • de: German (Germany, Switzerland)
  • es: Spanish
  • en: English (US, UK)
  • fr: French (Canada, France, Switzerland)
  • it: Italian (Italy, Switzerland)
  • ro: Romanian
  • ja: Japanese
  • pt: Portuguese

We manage the translations in Crowdin, please see https://crowdin.com/project/stac-browser/ for details.

To add your own language, please follow the guide below: Adding a new language

Custom phrases

You can define custom phrases in the custom.json. This is especially useful for phrases that are coming from non-standadized metadata fields (see the chapter "Additional metadata fields"). If you've found metadata labels (e.g. "Price" and "Generation Time") that are not translated, you can add it to the custom.json. For metadata fields you need to add it to a the object fields as it is the group for the metadata-related phrases. There you can add as many phrases as you like. For example:

{
  "fields": {
    "Price": "Preis",
    "Generation Time": "Generierungszeit"
  }
}

Themes

You can customize STAC Browser in the src/theme folder. It contains Sass files (a CSS preprocessor), which you can change to suit your needs.

The easiest solution is to start with the variables.scss file and customize the options given there. For simplicity we just provide some common options as default, but you can also add and customize any Bootstrap variable, see https://getbootstrap.com/docs/4.0/getting-started/theming/ for details.

The file page.scss contains some Sass declarations for the main sections of STAC Browser and you can adopt those to suit your needs.

If you need even more flexibility, you need to dig into the Vue files and their dependencies though.

Basemaps

The file basemaps.config.js contains the configuration for the basemaps. You can update either just the BASEMAPS object or you can write a custom function configureBasemap that returns the desired options for vue2-leaflet. XYZ and WMS basemaps are supported and have different options that you can set.

Actions

STAC Browser has a pluggable interface to share or open assets and links with other services, which we call "actions".

More information about how to add or implement actions can be found in the documentation.

Additional metadata fields

The metadata that STAC Browser renders is rendered primarily through the library stac-fields. It contains a lot of rules for rendering many existing STAC extensions nicely. Nevertheless, if you use custom extensions to the STAC specification you may want to register your own rendering rules for the new fields. This can be accomplished by customizing the file fields.config.js. It uses the Registry defined in stac-fields to add more extensions and fields to stac-fields and STAC Browser.

To add your own fields, please consult the documentation for the Registry.

Example

If you have a custom extension with the title "Radiant Earth" that uses the prefix radiant: you can add the extension as such:

Registry.addExtension("radiant", "Radiant Earth");

If this extension has a boolean field radiant:public_access that describes whether an entity can be accessed publicly or not, this could be described as follows:

Registry.addMetadataField("radiant:public_access", {
  label: "Data Access",
  formatter: (value) => (value ? "Public" : "Private"),
});

This displays the field (with a value of true) in STAC Browser as follows: Data Access: Public.

The first parameter is the field name, the second parameter describes the field using a "field specification". Please check the field specification for available options.

Translation

STAC Browser supports multiple languages. If you use more than one language, you likely want to also translate the phrases that you've added above (in the example Data Access, Public and Private, assuming that Radiant Earth is a name and doesn't need to be translated). All new phrases should be added to the active languages. To add the phrases mentioned above you need to go through the folders in src/locales and in the folders of the active languages update the file custom.json as described in the section that describes adding custom phrases. All new phrases must be added to the property fields.

Below you can find an example of an updated custom.json for the German language (folder de). It also includes the authConfig, which is contained in the file by default for other purposes.

{
  "authConfig": {
    "description": ""
  },
  "fields": {
    "Data Access": "Zugriff auf die Daten",
    "Public": "Öffentlich",
    "Private": "Privat"
  }
}

Customize through root catalog

You can also provide a couple of the config options through the root catalog. You need to provide a field stac_browser and then you can set any of the following options:

  • apiCatalogPriority
  • authConfig (except for the formatter as function)
  • cardViewMode
  • cardViewSort
  • crossOriginMedia
  • defaultThumbnailSize
  • displayGeoTiffByDefault
  • showThumbnailsAsAssets

Custom extensions

STAC Browser supports some non-standardized extensions to the STAC specification that you can use to improve the user-experience.

  1. Provider Object: Add an email (or mail) field with an e-mail address and the mail will be shown in the Browser.
  2. Alternative Assets Object: Add a name field and it will be used as title in the tab header, the same applies for the core Asset Object.
  3. A link with relation type icon and a Browser-supported media type in any STAC entity will show an icon in the header and the lists of Catalogs, Collections and Items.

Docker

Create a custom image

Building the Dockerfile without changing any build options:

docker build -t stac-browser:v1 .

Run the container for a specific URL:

docker run -p 8080:8080 -e SB_catalogUrl="https://earth-search.aws.element84.com/v1/" stac-browser:v1

STAC Browser is now available at http://localhost:8080


You can pass further options to STAC Browser to customize it to your needs.

The build-only options pathPrefix and historyMode can be provided as a build argument when building the Dockerfile.

For example:

docker build -t stac-browser:v1 --build-arg pathPrefix="/browser/" --build-arg historyMode=hash .

All other options, except the ones that are explicitly excluded from CLI/ENV usage, can be passed as environment variables when running the container. For example, to run the container with a pre-defined catalogUrl and catalogTitle:

docker run -p 8080:8080 -e SB_catalogUrl="https://earth-search.aws.element84.com/v1/" -e SB_catalogTitle="Earth Search" stac-browser:v1

If you want to pass all the other arguments to npm run build directly, you can modify to the Dockerfile as needed.

STAC browser is now available at http://localhost:8080/browser

Use an existing image

Since version 3.1.1, you can add an existing image from Packages to your docker-compose.yml:

services:
  stac-browser:
    image: ghcr.io/radiantearth/stac-browser:latest
    ports:
      - 8080:8080
    environment:
      SB_catalogUrl: "https://localhost:7188"

Contributing

We are happy to review and accept Pull Requests. STAC Browser is following the STAC code of conduct.

STAC Browser uses Vue and vue-cli, so you need a recent version of NodeJS and npm installed.

You can run the following commands (see also "Get started" above):

  • npm run install: Install the dependencies, this is required once at the beginning.
  • npm start: Start the development server
  • npm run lint: Lint the source code files
  • npm run build: Compile the source code into deployable files for the web. The resulting files can be found in the folder dist and you can then deploy STAC Browser on a web host. There are two other variants:
    • npm run build:report: Same as above, but also generates a bundle size report (see dist/report.html), which should not be deployed.
    • npm run build:minimal: Same as above, but tries to generate a minimal version without bundle size report and without source maps.
  • npm run i18n:fields: Generates an updated version of the locales from the stac-fields package.

The release process is documented separately.

Adding a new language

You can translate STAC Browser into other languages. You can also use one of the existing languages and provide an alternate version for a specifc country, e.g. a Australian English (en-AU) version of the US-English language pack (en).

Please follow this guide:

  • Copy the en folder (or any other language without a country code that you want to base the translation on).
    • Note: If you start with the en folder, you have to remove the leading // from the line // { fields: require('./fields.json') } in the file default.js.
  • Name the new folder according to RFC5646.
  • Add the language to the list of supported locales (supportedLocales) in the config.js file.
  • Add the language to the list of languages in this README file.
  • Add yourself to the list of code owners (.github/CODEOWNERS) for this language (we'll invite you to this repository after you've opened a PR). Persons contributing languages are expected to maintain them long-term! If you are not able to maintain the language pack, please indicate so in the PR and we'll release it separately.
  • Translate the .json files, most importantly config.json, fields.json and texts.json.
    • Please note that you never need to translate any object keys!
    • If you base your language on another existing language (e.g. create en-IN based on en) you can delete individual files and import existing files from other languages in default.js.
  • Adapt the datepicker.js, duration.js and validation.js files to import the existing definitions from their corresponding external packages, but you could also define the specifics yourself.
  • Check that your translation works by running the development server (npm start) and navigating to the STAC Browser instance in your browser (usually http://localhost:8080).
  • Once completed, please open a pull request and we'll get back to you as soon as possible.
  • After merging the PR for the first time, we'll add you to our translation management tool Crowdin: https://crowdin.com/project/stac-browser/. Please get in touch to get your invite!

Sponsors

The following sponsors have provided a substantial amount of funding for STAC Browser in the past:

stac-browser's People

Contributors

charlesbluca avatar constantinius avatar dereklieu avatar digitaltopo avatar drnextgis avatar drwelby avatar fabricebrito avatar firefishy avatar geospatial-jeff avatar glmxndr avatar jlaura avatar jqtrde avatar juliayun23 avatar keenan-nicholson avatar lossyrob avatar m-mohr avatar mneagul avatar mojodna avatar p1d1d1 avatar philvarner avatar rnanclares avatar rowanwins avatar schwehr avatar tmokmss avatar trevorlang avatar tschaub avatar tschumpr avatar uba avatar waystilos avatar zakjan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stac-browser's Issues

Add property key checks

  • are all property keys recognized / do they match keys defined in a specific profile (e.g. EO)?

Allow stac-browser to be whitelabeled

Several users have expressed their interest in being able to brand stac-browser with their own logos and color schemes.

The goal of this issue is to make stac-browser "theme-able", so that users can customize the logo and color palette as desired.

Related to #16

Incorporate validation

  • JSON schema validation using the STAC schemas
  • are items valid GeoJSON?
  • are catalogs valid JSON?
  • is CORS enabled on catalogs?
  • is CORS enabled on COGs (for in-browser GeoTIFF decoding)?
  • are all property keys recognized / do they match keys defined in a specific profile (e.g. EO)?

Separate Vue Components

For central components such as rendering the information of an Item, Catalog or Collection, it would be nice to de-couple these Vue components so others could include them in their Vue app. For example, I'd like to render STAC in an openEO Vue app and just re-use these functionality without copying code or writing everything again.

Directory not empty error, Vue package version mismatch on "npm start"

When running npm start -- --open to begin running a server, I get a "directory not empty" error:

> [email protected] start /mnt/c/Users/charlesbluca/Desktop/pangeo/stac-browser
> npm run clean && parcel --target=browser index.html "--open"


> [email protected] clean /mnt/c/Users/charlesbluca/Desktop/pangeo/stac-browser
> find dist ! -name _redirects -delete

find: cannot delete ‘dist’: Directory not empty

I'm able to get around this by editing the clean script to exclude directories, but after finishing this step a build error occurs due to mismatched Vue package versions:

🚨  /mnt/c/Users/charlesbluca/Desktop/pangeo/stac-browser/src/components/Catalog.vue: 

Vue packages version mismatch:

- [email protected] (/mnt/c/Users/charlesbluca/Desktop/pangeo/stac-browser/node_modules/vue/dist/vue.runtime.common.js)
- [email protected] (/mnt/c/Users/charlesbluca/Desktop/pangeo/stac-browser/node_modules/vue-template-compiler/package.json)

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

I was also able to get around this by bumping the vue-template-compiler version to ^2.6.12.

Are these errors reproducible? This is running on an Ubuntu environment through Windows Subsystem for Linux.

Flesh out readme with a bit more on how to use STAC Browser locally

I was about to do a quick PR, but then realized I'm not totally sure if I have the right approach.

I've been using npx http-server --cors='*' <folder with STAC in it>. But then I saw the line about a proxy server, and not sure if I could do that. It sounds promising, but I'm not sure how I 'run the proxy server'.

Maybe the info is all there - I'm a bit dense with this stuff. But perhaps a section that is just 'using STAC browser with a local STAC'.

Navigating to "related" collections/catalogs

The STAC collection spec defines some relations that are meant to refer to other STAC collections via their URL (e.g. rel="derived_from"). Could STAC browser allow visualising/hyperlinking to some of these relations (if the rel-type is configured to be shown), and possibly support a more general relation such as rel="related" (with type="application/json") ? Uses cases are to refer to catalogs with data from other instruments for the same platform, or same instrument in a different mode or catalogs/collections for the same platform from other organisations etc..

Render license URL for non-SPDX licenses

Would it be possible, on the collection-level pages, to make stac-browser pull the license URL from links if the license isn't registered in SPDX (see https://github.com/radiantearth/stac-spec/blame/dev/collection-spec/collection-spec.md#L34).

Here is an example collection (https://cognition-disaster-data.s3.amazonaws.com/NOAAStorm/hurricane-barry@storm/catalog.json) which you can also view in stac-browser (https://cognition-disaster-data.netlify.com/?t=catalogs).

Map not shown

When browsing through catalogs / items with STAC Browser, sometimes the console shows errors such as:

  • Error: Map container not found.
  • Error: Map container reused...

That sounds a bit like when switching between Items some map related state is not cleared.

Make STAC Browser more lightweight

An intial request to the Planed Disaster Catalog requires to load a total of 3,6MB (uncompressed) / 0.77KB (compressed) in STAC Browser 1.0:

  • HTML: Neglectable
  • CSS: 0.27 / 0.03 MB (much of this is cached in subsequent calls)
  • JS: 3,21 / 0.67 MB (much of this is cached in subsequent calls)
  • JSON: 10 / 0.02 MB (subsequent calls, e.g. for items, are larger as more parts of the catalog need to be loaded, e.g. JSON Schemas, parent catalogs, ...)
  • Imagery: Not looking into it, can't change it

Even on a 4G connection the initial load time is multiple seconds, don't even try 3G...

I'd like to reduce this as far as possible. With STAC Index I've also realized that the bundle size is an issue for the crawlers.

screenshot / demo site?

I am new to STAC and trying to learn more about the tools available. This looks like a very cool project! Thanks to all the contributors to stac-browser for your open-source efforts.

I am curious if there is a demo site somewhere or even a screenshot that shows what the catalog browser actually looks like.

eo:bands header rendering

Hello,
eo:bands header is not rendering properly, as you can see when browsing https://tamn.snapplanet.io/collections/S2 through https://stacindex.org/catalogs/sentinel-2-and-landsat-8-catalog . HTML code is displayed in the header:
image

Also another screenshot from the latest stac-browser version running locally:
image

Part of the JSON code from collection or item:

"properties":{
  "eo:bands":[
    {"center_wavelength":0.4439,"common_name":"coastal","full_width_half_max":0.027,"gsd":60,"name":"B01"},
    {"center_wavelength":0.4966,"common_name":"blue","full_width_half_max":0.098,"gsd":10,"name":"B02"},

Collections support

In an item, e.g.

{
  // ...
  "links": [
    {
      "rel": "collection",
      "href": "https://cbers-stac.s3.amazonaws.com/collections/CBERS_4_MUX_L2_collection.json"
    }
  ],
  ...
}

Show Collection Summaries

The STAC Browser doesn't support Collection Summaries yet, but they are an important way to help with navigating the catalogs.

Publish on npm / Reccommended way to add STAC Browser to existing Vue website?

I am trying to publish an instance of STAC Browser as a subdirectory to an existing Vue website published through Netlify.

What is the best way to do this that allows us to easily pull changes happening in this repo (such as additional features relating to Zarr)? To my knowledge, there isn't a package on npm to add as a dependency to the existing project, so I was planning to deploy the STAC Browser separately from the main website. For handling new changes to the browser, I figured I could either:

  • Make a fork of this repo and have Netlify deploy from there, pulling changes as they come
  • git clone the version of STAC Browser I want as part of the Netlify deployment process

Would these be my best options, or is there an easier way to do this?

cc: @rabernat

Enable "prev" and "next" buttons for catalogs that implement paging links

While not part of the spec, some users have been using a convention to use a "next" and "prev" link in catalogs and collections to enable pagination for large sets of subcatalogs.

Enable this in stac-browser by implementing "prev" and "next" buttons for subcatalogs that operates similar to how pagination works for items.

multi-polygons as extent

Hello,
I have a collection with a multi-polygon as geometry. From https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md#spatial-extent-object it seams that the extent should a list containing each polygon's bounds. Something like:

"extent":{
  "spatial":{
    "bbox":[
      [-4.592349819344776,42.34338471126569,8.099278598674744,51.14850617126183],
      [-54.524754197799716,2.0533891870159806,-51.65779741067889,5.756548163267765],
      [8.544212680707773,41.380006822264455,9.560016310269134,43.00998484961471]
    ]
  },

But this way, stac-browser only plots the first bbox in the collection map:
image

I am running stac-browser latest version from github (2020-11-18)

landsat.stac.cloud fails to load

landsat.stac.cloud was failing to load and throwing the following error.
vue.common.js:1843 TypeError: Cannot read property 'license' of undefined

Although this may be a non-issue. After clearing my cache the site loaded correctly.

Add CORS checks

Surface errors if these fail:

  • is CORS enabled on catalogs?
  • is CORS enabled on COGs (for in-browser GeoTIFF decoding)?

Resolve cloud storage URLs to HTTP for download purposes

I.e. s3://whatever/filehttps://whatever.s3.amazonaws.com/file (for publicly-accessible data).

Should we or shouldn't we (since we don't know permissions)? A rel=alternate (or http / public / something property on the link) equivalent might be a better mechanism, since it's explicit on the provider's part.

Alphabetize children, items, and assets

There was previously an explicit ordering when these were arrays, but now that they're keyed objects, ordering is only implicit (and not to be assumed). Alphabetizing them by name (or its equivalent, if absent) will make these easier to navigate and will no longer override the author's intent.

Add a 'powered by stac-browser' with link to github repo

Should add a small footer to each page so people know that it's an open source thing powering what they're seeing, and can go to the repo and learn more about how it works.

Can just put it in the default templates - people wouldn't have to include it.

Configure a Netlify deploy button

Allow CATALOG_URL to be configured when creating a new site; this will allow people who want to stand up their own catalogs to do so without cloning the repo and configuring it.

Non root URL

I was trying to deploy the STAC Browser at a place where it is not at the domain root. For example, I wanted to have it someplace like https://storage.googleapis.com/example-bucket/some-prefix/stac/index.html.

Since Parcel generates absolute paths to resources by default, it doesn't work to use npm run build directly as that will generate an index.html with things like:

<script src="/main.3d4dd6c5.js"></script>

And this doesn't work since the main bundle is not going to be at the root.

If I run parcel with --public-url ./, I get a more portable index.html, with this:

<script src="main.3d4dd6c5.js"></script>

This works well until I start navigating the site. When I click on one of the items in the catalog, the client navigates to a URL like this: https://storage.googleapis.com/item/example-bucket/some-prefix/stac/index.html/Ed4DAgh7Zv45s8U25Fi7pkiMQLEzdj?t=assets

Note that item has been placed ahead of example-bucket in the path. Since I don't control the item GCS bucket, this URL is not one that I can pass around to others. And unfortunately, the owner of the item bucket has an account that is not in good standing, so when users go to that URL they see this:

<?xml version='1.0' encoding='UTF-8'?>
<Error>
    <Code>UserProjectAccountProblem</Code>
    <Message>User project billing account not in good standing.</Message>
    <Details>The billing account for project 270190242553 is disabled in state absent</Details>
</Error>

What do others do to use the STAC Browser when it is not hosted at the root?

Thanks for your work on this project!

Blank page when there are errors in the catalog

I didn't put a STAC_VERSION in the catalog, so the console has got errors, but the user just gets a blank.

util.js:15 GET https://storage.googleapis.com/earthengine-stac-experimental/catalog-v000/catalog.json net::ERR_FAILED
_callee$ @ util.js:15
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ util.js:3
_next @ util.js:3
(anonymous) @ util.js:3
(anonymous) @ util.js:3
_fetchUri @ util.js:13
fetchUri @ util.js:13
_callee4$ @ main.js:253
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ main.js:25
_next @ main.js:25
(anonymous) @ main.js:25
(anonymous) @ main.js:25
load @ main.js:243
wrappedActionHandler @ vuex.esm.js:851
dispatch @ vuex.esm.js:516
boundDispatch @ vuex.esm.js:406
_callee6$ @ main.js:280
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ main.js:25
_next @ main.js:25
(anonymous) @ main.js:25
(anonymous) @ main.js:25
main @ main.js:78
parcelRequire.src/main.js.core-js/modules/es6.array.copy-within @ main.js:327
newRequire @ main.1e43358e.js:47
(anonymous) @ main.1e43358e.js:81
(anonymous) @ main.1e43358e.js:120
Show 5 more frames
main.js:263 TypeError: Failed to fetch
_callee4$ @ main.js:263
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ main.js:25
_throw @ main.js:25
Promise.then (async)
asyncGeneratorStep @ main.js:25
_next @ main.js:25
(anonymous) @ main.js:25
(anonymous) @ main.js:25
load @ main.js:243
wrappedActionHandler @ vuex.esm.js:851
dispatch @ vuex.esm.js:516
boundDispatch @ vuex.esm.js:406
_callee6$ @ main.js:280
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ main.js:25
_next @ main.js:25
(anonymous) @ main.js:25
(anonymous) @ main.js:25
main @ main.js:78
parcelRequire.src/main.js.core-js/modules/es6.array.copy-within @ main.js:327
newRequire @ main.1e43358e.js:47
(anonymous) @ main.1e43358e.js:81
(anonymous) @ main.1e43358e.js:120
vue.common.dev.js:630 [Vue warn]: Error in getter for watcher "entity": "ReferenceError: STAC_VERISON is not defined"

found in

---> <Catalog>
       <Root>
warn @ vue.common.dev.js:630
logError @ vue.common.dev.js:1889
globalHandleError @ vue.common.dev.js:1884
handleError @ vue.common.dev.js:1844
get @ vue.common.dev.js:4477
Watcher @ vue.common.dev.js:4463
Vue.$watch @ vue.common.dev.js:4938
createWatcher @ vue.common.dev.js:4898
initWatch @ vue.common.dev.js:4880
initState @ vue.common.dev.js:4643
Vue._init @ vue.common.dev.js:4996
VueComponent @ vue.common.dev.js:5143
createComponentInstanceForVnode @ vue.common.dev.js:3286
init @ vue.common.dev.js:3117
merged @ vue.common.dev.js:3304
createComponent @ vue.common.dev.js:5969
createElm @ vue.common.dev.js:5916
patch @ vue.common.dev.js:6505
Vue._update @ vue.common.dev.js:3942
updateComponent @ vue.common.dev.js:4063
get @ vue.common.dev.js:4474
Watcher @ vue.common.dev.js:4463
mountComponent @ vue.common.dev.js:4070
Vue.$mount @ vue.common.dev.js:9040
Vue.$mount @ vue.common.dev.js:11940
Vue._init @ vue.common.dev.js:5008
Vue @ vue.common.dev.js:5074
_callee6$ @ main.js:319
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ main.js:25
_next @ main.js:25
Promise.then (async)
asyncGeneratorStep @ main.js:25
_next @ main.js:25
(anonymous) @ main.js:25
(anonymous) @ main.js:25
main @ main.js:78
parcelRequire.src/main.js.core-js/modules/es6.array.copy-within @ main.js:327
newRequire @ main.1e43358e.js:47
(anonymous) @ main.1e43358e.js:81
(anonymous) @ main.1e43358e.js:120
Show 3 more frames
vue.common.dev.js:1893 ReferenceError: STAC_VERISON is not defined
    at transformCatalog (migrate.js:8)
    at VueComponent._entity (Catalog.vue:424)
    at Watcher.get (vue.common.dev.js:4474)
    at Watcher.evaluate (vue.common.dev.js:4579)
    at VueComponent.computedGetter [as _entity] (vue.common.dev.js:4828)
    at VueComponent.errored (common.js:199)
    at Watcher.get (vue.common.dev.js:4474)
    at Watcher.evaluate (vue.common.dev.js:4579)
    at VueComponent.computedGetter [as errored] (vue.common.dev.js:4828)
    at VueComponent.entity (common.js:202)
logError @ vue.common.dev.js:1893
globalHandleError @ vue.common.dev.js:1884
handleError @ vue.common.dev.js:1844
get @ vue.common.dev.js:4477
Watcher @ vue.common.dev.js:4463
Vue.$watch @ vue.common.dev.js:4938
createWatcher @ vue.common.dev.js:4898
initWatch @ vue.common.dev.js:4880
initState @ vue.common.dev.js:4643
Vue._init @ vue.common.dev.js:4996
VueComponent @ vue.common.dev.js:5143
createComponentInstanceForVnode @ vue.common.dev.js:3286
init @ vue.common.dev.js:3117
merged @ vue.common.dev.js:3304
createComponent @ vue.common.dev.js:5969
createElm @ vue.common.dev.js:5916
patch @ vue.common.dev.js:6505
Vue._update @ vue.common.dev.js:3942
updateComponent @ vue.common.dev.js:4063
get @ vue.common.dev.js:4474
Watcher @ vue.common.dev.js:4463
mountComponent @ vue.common.dev.js:4070
Vue.$mount @ vue.common.dev.js:9040
Vue.$mount @ vue.common.dev.js:11940
Vue._init @ vue.common.dev.js:5008
Vue @ vue.common.dev.js:5074
_callee6$ @ main.js:319
tryCatch @ runtime.js:63
invoke @ runtime.js:293
(anonymous) @ runtime.js:118
asyncGeneratorStep @ main.js:25
_next @ main.js:25
Promise.then (async)
asyncGeneratorStep @ main.js:25
_next @ main.js:25
(anonymous) @ main.js:25
(anonymous) @ main.js:25
main @ main.js:78
parcelRequire.src/main.js.core-js/modules/es6.array.copy-within @ main.js:327
newRequire @ main.1e43358e.js:47
(anonymous) @ main.1e43358e.js:81
(anonymous) @ main.1e43358e.js:120
Show 2 more frames
vue.common.dev.js:630 [Vue warn]: Error in getter for watcher "$metaInfo": "ReferenceError: STAC_VERISON is not defined"

found in

---> <Catalog>
       <Root>

Visualize groups of items (and collections) in a map

When you get to page that lists several items, so 1 level from the bottom (this may also in part apply to items), provide a map viewer showing the extents of the sub-items, and allow those extents to be click-able links to the items. This should be driven by the geojson extents of the items themselves.

I prototyped an interface previously that explains this suggestion:
https://test2.biogeo.ucdavis.edu/spatialdata/example/

  • Outline is the overall extent of all the items at a given level.
  • Tiles is the extent of each item
  • Coverage is a mask of data vs no data (may require pre-rendered pngs or some smarter method)
  • Preview would be the current COG implementation.

The normal list of items should come below the map.

Source code for the above example is available at:
https://bitbucket.org/spatial-ucd/data/src/preview/example/

Don't require Python 2 / Windows support

npm install on Windows 10 requires Python 2:

PS C:\projects\stac-browser> npm install

> [email protected] install C:\projects\stac-browser\node_modules\deasync
> node ./build.js


C:\projects\stac-browser\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is "C:\Users\Matthias Mohr\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe"
gyp ERR! find Python - version is "3.8.5"
gyp ERR! find Python - version is 3.8.5 - should be >=2.6.0 <3.0.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python 2.7.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:303:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:132:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:221:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:267:16)
gyp ERR! stack     at exithandler (child_process.js:302:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:314:5)
gyp ERR! stack     at ChildProcess.emit (events.js:209:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:456:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:80:21)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\projects\stac-browser\node_modules\deasync
gyp ERR! node -v v12.10.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
Build failed
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\netlify-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node ./build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Matthias Mohr\AppData\Roaming\npm-cache\_logs\2020-08-25T15_08_23_072Z-debug.log
PS C:\projects\stac-browser>

For me it feels like there are two things wrong with this:

  1. Why is Python required for a node project?
  2. Why is an outdated Python required? If it would be v3 okay, but I don't want to bloat my PC with legacy Python version tbh.

Easy execution via CLI

Make runnning a STAC Browser as easy as npx @radiantearth/stac-browser <location>.

For local testing (i.e. no http[s]) use http-server to start a server for the local files.

Get rid of the environment variables (cross-plattform support!) and instead have either a config file or the CLI parameters.

Paginate list of child catalogs

(From #8)

It would be also nice to have pagination enabled for children catalogs list since this has the potential of being very long depending on how the data is organized.

Search Interface for STAC API

Hello,

I'm considering making a contribution and am wondering if there's interest for adding a search page on the browser that enables user to search items by collection name, time, and geometry? This would likely be a map display of items available along with a form on the side. Once an item is selected, the user will be redirected to the items page. As well, the search UI will likely work only with STAC API, and not with static catalogs.

Suggestions are welcome

How to integrate a zarr component into stac-browser

We are working on referencing Zarr stores as collection-level assets from STAC catalogs (see radiantearth/stac-spec#781 for discussion). We will basically point to a .zmetadata json file which represents the zarr "consolidated metadata" for the store. Here is an example of what this file looks like: https://storage.googleapis.com/cmip6/tracmip/A3hr/aqua4xCO2/AM21/hus/v20190116/.zmetadata

Now we would like to figure out how to render some of this metadata in stac browser. I hacked together some vue components for doing this from a single zarr store here: https://github.com/rabernat/zarr-metadata-vue-browser; but I am very far from a competent vue developer.

Can you provide some guidance on the overall architecture for integrating a custom collection-level asset viewer into a stac browser?

cc @charlesbluca @jhamman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.