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

Awesome Spectral Indices for the Google Earth Engine JavaScript API (Code Editor).

License

NotificationsYou must be signed in to change notification settings

awesome-spectral-indices/spectral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Awesome Spectral Indices for theGoogle Earth Engine JavaScript API (Code Editor)

Documentation Statushttps://img.shields.io/badge/Paper-10.5194%2Fisprs--archives--XLVIII--4--W1--2022--301--2022-brightgreenhttps://img.shields.io/endpoint?url=https://gist.githubusercontent.com/davemlz/5e9f08fa6a45d9d486e29d9d85ad5c84/raw/spectral.jsonhttps://img.shields.io/twitter/follow/dmlmont?style=social

Overview

Google Earth Engine (GEE) is a cloud-based service for geospatial processing of vector and raster data. The Earth Engine platform has aJavaScript and a Python API with different methods to process geospatial objects. Google Earth Engine also provides aHUGE PETABYTE-SCALE CATALOG of raster and vector data that users can process online. TheAwesome Spectral Indices is a standardized ready-to-use curated list of spectral indices that can be used as expressions for computing spectral indices in GEE. The spectral module extends the GEE JavaScript API with new functions to access and compute spectral indices from theAwesome List of Spectral Indices.

Check the simple usage of spectral here:

varspectral=require("users/dmlmont/spectral:spectral");vardataset="COPERNICUS/S2_SR";varS2=ee.ImageCollection(dataset).first();varS2=spectral.scale(S2,dataset);varparameters={"N":S2.select("B8"),"R":S2.select("B4"),"G":S2.select("B3"),"L":0.5};varS2=spectral.computeIndex(S2,["NDVI","GNDVI","SAVI"],parameters);

List

Check the full list of spectral indiceshere.

How does it work?

The spectral module can be acceptedHERE. Once accepted, it can be required by running the following line in theGEE JavaScript Code Editor:

varspectral=require("users/dmlmont/spectral:spectral");

The complete list of spectral indices can be accessed by using theindices attribute:

print(spectral.indices);

The list of available attributes for a specific index can be accessed using dot notation:

print(spectral.indices.NDVI);

Or by using a key:

print(spectral.indices["NDVI"]);

An attribute can be accessed using also dot notation:

print(spectral.indices.NDVI.formula);

Or by using a key:

print(spectral.indices.NDVI["formula"]);

The available attributes of an index are:

  • short_name: Short name of the index (e.g."NDWI").
  • long_name: Long name of the index (e.g."Normalized Difference Water Index").
  • formula: Expression/formula of the index (e.g."(G - N)/(G + N)").
  • bands: List of required bands/parameters for the index computation (e.g.["N","G"]).
  • reference: Link to the index reference/paper/doi (e.g."https://doi.org/10.1080/01431169608948714").
  • type: Type/application of the index (e.g."water").
  • date_of_addition: Date of addition to the list (e.g."2021-04-07").
  • contributor: GitHub user link of the contributor (e.g."https://github.com/davemlz").

Finally, an index (e.g. NDVI) can be computed using thecomputeIndex(img, index, params) function:

vardataset="COPERNICUS/S2_SR";varS2=ee.ImageCollection(dataset).first()varS2=spectral.scale(S2,dataset);varparameters={"N":S2.select("B8"),"R":S2.select("B4"),};varS2=spectral.computeIndex(S2,"NDVI",parameters);

And multiple indices can be computed using an array of indices:

vardataset="COPERNICUS/S2_SR";varS2=ee.ImageCollection(dataset).first()varS2=spectral.scale(S2,dataset);varparameters={"N":S2.select("B8"),"R":S2.select("B4"),"G":S2.select("B3"),"L":0.5};varS2=spectral.computeIndex(S2,["NDVI","GNDVI","SAVI"],parameters);

All specified indices are added as new bands.

License

The project is licensed under the MIT license.

How to cite

Do you like usingspectral and think it is useful? Share the love by citing it!

Montero, D., Aybar, C., Mahecha, M. D., Wieneke, S. (2022). spectral: Awesome Spectral Indices deployedvia the Google Earth Engine JavaScript API. The International Archives of the Photogrammetry, Remote Sensingand Spatial Information Sciences, Volume XLVIII-4/W1-2022. Free and Open Source Software for Geospatial(FOSS4G) 2022 Academic Track, 22-28 August 2022, Florence, Italy. doi: 10.5194/isprs-archives-XLVIII-4-W1-2022-301-2022

If required, here is the BibTex!

@article{Montero2022,   doi = {10.5194/isprs-archives-XLVIII-4-W1-2022-301-2022},   url = {https://doi.org/10.5194/isprs-archives-XLVIII-4-W1-2022-301-2022},   year = {2022},   volume = {XLVIII-4/W1-2022},   pages = {301-306},   author = {David Montero, Cesar Aybar, Miguel D. Mahecha, Sebastian Wieneke},   title = {spectral: Awesome Spectral Indices deployed via the Google Earth Engine JavaScript API},   journal = {The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences}}

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp