Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A repository of custom scripts to be used with Sentinel Hub

License

NotificationsYou must be signed in to change notification settings

sentinel-hub/custom-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Examples of visualizations

This repository contains a collection of custom scripts forSentinel Hub, which can be fed to the services via the URL.

Custom scripts are a piece of Javascript code, used to visualize satellite imagery and to control what values the Sentinel Hub services will return. Any visualization of any constellation (e.g. Sentinel-2 satellite), even a simple true color composite, is dictated by a custom script.

Seehere for more information on how to write your own evalscript.

Contribute to Custom Scripts

Have a look at thetemplate for an example of how a script page can be structured.

You can also have a look at other scripts to see how they are structured.

For instructions on how custom scripts are structured have a look at thistutorial, or at theofficial documenation.


How to publish your own product

  • Fork the repository to get your own copy of the custom-scripts
    It is easiest to fork the repository on GitHub, but as some of you might not have GitHub account, or don't want to bother with all this versioning and collaboration tools, you can also just download the whole repository as Zip file and work from there.
  • Create a new directory entry for your custom script
    Copy theexample directory to proper directory, based on which datasource (satellite) you are publishing the product for, to something that describes what the product is about, saymy_algorithm.
    Preferably use"snake_case" (underscores instead of spaces) if more than one word is used.
  • Fill in the details about the project in theREADME.md file.
    Obviously, you'll want to remove this chapter, but use the rest of the file as a template.
    Have a look around at otherREADME.md files to see how to include images, format the text and generally use the GitHubmarkdown (e.g.here for mathematical formulas orhere for adding images).
  • Implement the product in thescript.js file.
    The most work is of course the JavaScript implementation of the product. Theexample folder includes an empty custom script with comments that will hopefully help you build your own custom script.
  • Add an entry pointing to your script to the top level markdown file (i.e. if adding a script for Sentinel 2 add the link tosentinel-2.md in the foldersentinel-2).
    A link and a short description will do.
  • And create a pull request :).There is extensive help on creating pull requests on GitHubhelp, but if you feel overwhelmed by this step and would still like to contribute, send us the folder you've created and we will take care of it for you.

Publishing your product should be easy, nevertheless, any feedback and ideas how to improve or make the process simpler is very appreciated.

Test your changes locally

This is optional but makes Pull Requests quicker to handle since they should have less mistakes.
Before you create the PR you can check if everything looks right on the website. To do this follow these steps which are based onTesting your GitHub Pages site locally with Jekyll page:

Linux
  • In the root directory of your fork open a terminal
  • Install ruby
    • Ubuntu:sudo apt install ruby ruby-dev
  • Install bundler
    • gem install bundler
    • On Ubuntu you might have to addsudo
  • Create a Gemfile
    • In the root folder of the repository (where the_config.yml file is) create a new fileGemfile.
    • i.etouch Gemfile
    • and add the following content:
source 'https://rubygems.org'gem "github-pages", "~> GH_VERSION", group: :jekyll_pluginsgem "just-the-docs"

ReplaceGH_VERSION with the version number that is displayed next to github-pageshere.

  • Serve the page
    • First install all necessary gems withbundle install
    • then the site can be built withbundle exec jekyll serve
    • The site should then be visible on127.0.0.1:4000
macOS
  • In the root directory of your fork open a terminal

  • Install ruby

    • brew install chruby ruby-install xz

      • If homebrew hasn't been installed yet, intall homebrew
      /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    • ruby-install ruby 3.1.3

    • After installation run the following codes:

    echo "source $(brew --prefix)/opt/chruby/share/chruby/chruby.sh" >> ~/.zshrcecho "source $(brew --prefix)/opt/chruby/share/chruby/auto.sh" >> ~/.zshrcecho "chruby ruby-3.1.3" >> ~/.zshrc # run 'chruby' to see actual version
    • Quit and relaunch Terminal, then check that everything withruby -v
    • It should show ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) or a newer version
  • Install Jekyll

    • gem install jekyll
  • Install bundler

    • gem install bundler
  • Following theCreate a Gemfile step in the Linux section

  • Serve the page

    • First install all necessary gems withbundle install

    • Add the missing webrick package withbundle add webrick

      • Run this command again when the following error message pops out:
      bundler: failed to load command: jekyll
    • then the site can be built withbundle exec jekyll serve

    • The site should then be visible on127.0.0.1:4000

About

A repository of custom scripts to be used with Sentinel Hub

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors55


[8]ページ先頭

©2009-2025 Movatter.jp