GithubHelp home page GithubHelp logo

jsiarto / stac-browser Goto Github PK

View Code? Open in Web Editor NEW

This project forked from radiantearth/stac-browser

0.0 1.0 0.0 111.95 MB

A Vue-based STAC browser for static catalogs and APIs

Home Page: https://radiantearth.github.io/stac-browser

License: ISC License

JavaScript 21.93% HTML 0.83% Vue 74.37% CSS 2.87%

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: 2.0.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.

Examples

For a longer list of examples, checkout out STAC Index.

Running

First, you need to install all dependencies:

npm install

By default, stac-browser will browse the testbed Planet catalog.

To browse your own, set the CATALOG_URL CLI parameter when running the dev server:

npm start -- --open --CATALOG_URL="http://path/to/catalog.json"

Deprecated: You can also set the environment variable CATALOG_URL instead of using the CLI parameter:

  • Linux/Unix/MacOS: CATALOG_URL=http://path/to/catalog.json
  • Windows PowerShell: $env:CATALOG_URL = "http://path/to/catalog.json"
  • Windows CMD: SET CATALOG_URL="http://path/to/catalog.json"

Other options

All the following options can be used as explained in the chapter "Running", either as CLI Parameter or as environment variable (deprecated).

HISTORY_MODE

STAC Browser defaults to using HTML5 History Mode, which can cause problems on certain web hosts. To use hash mode, set --HISTORY_MODE=hash when running or building. This will be compatible with S3, stock Apache, etc.

PATH_PREFIX

If you don't deploy the STAC Browser instance at the root path of your (sub) domain, then you need to set the path prefix when building (or running) STAC Browser.

npm run build -- --PATH_PREFIX="/browser/"

This will build STAC Browser in a way that it can be hosted at https://example.com/browser for example. Using this parameter for the dev server will make STAC Browser available at http://localhost:8080/browser.

STAC_PROXY_URL

Setting the STAC_PROXY_URL allows users to modify the URLs contained in the catalog to point to another location. For instance, if you are serving a catalog on the local file system at /home/user/catalog.json, but want to serve the data out from a server located at http://localhost:8888/, you can use:

npm start -- --open --STAC_PROXY_URL="/home/user|http://localhost:8888"

Notice the format of the value: it is the original location and the proxy location separated by the | character, i.e. {original}|{proxy}.

In this example, any href contained in the STAC (including link or asset hrefs) will replace any occurrence of /home/user/ with http://localhost:8888.

This can also be helpful when proxying a STAC that does not have cors enabled; by using STAC_PROXY_URL you can proxy the original STAC server with one that enables cors and be able to browse that catalog.

TILE_SOURCE_TEMPLATE

The TILE_SOURCE_TEMPLATE environment variable controls the tile layer that is used to render COGs. If not set, the default value is: https://tiles.rdnt.io/tiles/{z}/{x}/{y}@2x?url={ASSET_HREF}, which uses the tiles.rdnt.io project to serve publicly accessible COGs as tile layers.

The format of this value is a tile layer template with an optional {ASSET_HREF} that will be replaced with the COG asset href. For example, using a local version of titiler to serve local COG files would look something like:

npm start -- --open --TILE_SOURCE_TEMPLATE="http://localhost:8000/cog/tiles/{z}/{x}/{y}?url={ASSET_HREF}"

TILE_PROXY_URL

TILE_PROXY_URL is very similar to STAC_PROXY_URL, but is only used for asset hrefs passed into the TILE_SOURCE_TEMPLATE. This enables deployment scenarios where the tiler needs to reference a proxy server by a different name, e.g. in a docker-compose setup with linked containers.

Building

npm run build -- --CATALOG_URL="http://path/to/catalog.json"

If you'd like to publish the STAC Browser instance not on the root path of your domain, you can use the PATH_PREFIX option (see above).

Publishing

After building, dist/ will contain all assets necessary to host the browser. These can be manually copied to your web host of choice.

Contributing

STAC Browser uses Vue.

Catalogs and collections are rendered using the Catalog component in src/components/. Items are rendered using the Item component. Common functionality across both components exists in src/components/common.js.

stac-browser's People

Contributors

charlesbluca avatar dereklieu avatar digitaltopo avatar glmxndr avatar jqtrde avatar lossyrob avatar m-mohr avatar mojodna avatar schwehr avatar

Watchers

 avatar

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.