Giter VIP home page Giter VIP logo

awesome-spectral-indices / spectral Goto Github PK

View Code? Open in Web Editor NEW
165.0 10.0 37.0 17.45 MB

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

Home Page: https://ee-spectral.readthedocs.io/

License: MIT License

JavaScript 100.00%
google-earth-engine earth-engine spectral spectral-data spectral-dataset javascript spectral-indices spectral-index remote-sensing gis

spectral's Introduction


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

image

image

Documentation Status

image

image

image

image

image

image

image

Overview

Google Earth Engine (GEE) is a cloud-based service for geospatial processing of vector and raster data. The Earth Engine platform has a JavaScript and a Python API with different methods to process geospatial objects. Google Earth Engine also provides a HUGE PETABYTE-SCALE CATALOG of raster and vector data that users can process online. The Awesome 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 the Awesome List of Spectral Indices.

Check the simple usage of spectral here:

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

var dataset = "COPERNICUS/S2_SR";

var S2 = ee.ImageCollection(dataset).first();
var S2 = spectral.scale(S2,dataset);

var parameters = {
    "N": S2.select("B8"),
    "R": S2.select("B4"),
    "G": S2.select("B3"),
    "L": 0.5
};

var S2 = spectral.computeIndex(S2,["NDVI","GNDVI","SAVI"],parameters);

List

Check the full list of spectral indices here.

How does it work?

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

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

The complete list of spectral indices can be accessed by using the indices 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 the computeIndex(img, index, params) function:

var dataset = "COPERNICUS/S2_SR";

var S2 = ee.ImageCollection(dataset).first()
var S2 = spectral.scale(S2,dataset);

var parameters = {
    "N": S2.select("B8"),
    "R": S2.select("B4"),
};

var S2 = spectral.computeIndex(S2,"NDVI",parameters);

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

var dataset = "COPERNICUS/S2_SR";

var S2 = ee.ImageCollection(dataset).first()
var S2 = spectral.scale(S2,dataset);

var parameters = {
    "N": S2.select("B8"),
    "R": S2.select("B4"),
    "G": S2.select("B3"),
    "L": 0.5
};

var S2 = 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 using spectral 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 deployed
via the Google Earth Engine JavaScript API. The International Archives of the Photogrammetry, Remote Sensing 
and 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}
}

spectral's People

Contributors

actions-user avatar davemlz 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

spectral's Issues

SAVI and other indices require reflectance values

Many spectral indices (e.g. SAVI) in your list require reflectance values and don't work with the default values. Please multiply the pixel values by 'scale' (0.0001) when you use Sentinel-2 or Landsat5/7/8 SR products.

Add `omega`

Add omega parameter for MBWI. Default = 2.

Exporting indices as 16 bit shorts

Hi David – thanks for an awesome library! This is already saving me so much work looking up / hardcoding index formulas...

I'm exporting all of my images as 16 bit integers, and in for many indices I'm seeing discrete integer values and some that are simply binary... This is telling me I need to multiply by 1000 (or similar) in some cases. This is what I do with NDVI that I compute on my own.

So I'm wondering if this a common issue, and if there is someway to tell which indices need to be scaled beyond just a call to spectral.computeIndex? Perhaps the problem is simply that I'm casting everything to 16 bit integers so I'm on my own...

Thank you!

Scale factors of Landsat 8 Collection 2

It seems that the scale factors of bands SR_B1 to SR_B7 from the LANDSAT/LC08/C02/T1_L2 collection are incorrect.

var spectral = require('users/dmlmont/spectral:spectral');
print(spectral.scaleParameters['LANDSAT/LC08/C02/T1_L2']);

Captura de Tela 2021-09-03 às 22 38 26

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.