Code Monkey home page Code Monkey logo

gee-blend's Introduction

gee-blend

Jesse Anderson

About

gee-blend is a code module for using blended visualizations in Google Earth Engine. It can be loaded in the playground by clicking here, which will add the repository containing the code to the Reader section of the Scripts tab, under users/jja/public. The script blend_demo.js illustrates some of its basic functionality.

Using the Module

You can load the module in your code by running

var blend = require('users/jja/public:blend.js');

Blend functions can be applied using the following pattern: blend.<function>(top_image, bottom_image); Where <function> is one of the following:

  • addition
  • burn
  • darken
  • difference
  • dodge
  • hard_light
  • lighten
  • multiply
  • normal
  • overlay
  • screen
  • subtract

`

Here is an example blend operation and output.

Code:

// First, add the module to your account by going to https://code.earthengine.google.com/?accept_repo=users/jja/public

// Load the module
var blend = require('users/jja/public:blend.js');

// Load and visualize a digital elevation model
var dem = ee.Image("CGIAR/SRTM90_V4");
var dem_rgb = dem.visualize({
  min:100, 
  max:6000, 
  palette: ['#000004', '#50127b', '#b63679', '#fc8761', '#fdfd65'],
  forceRgbOutput:true
});

// Derive and visualize a slope image
var slope_rgb = ee.Terrain.slope(dem).visualize({
  min:0, 
  max:90, 
  palette: ['#000000', '#ffffff'],
  forceRgbOutput:true
});

// Use the `difference` blend function and add to the map
Map.addLayer(blend.difference(dem_rgb, slope_rgb), {min:-41, max:163});

// Zoom to an interesting location
Map.setCenter(71.2, 36, 9);

Image: blend_ex_1

Some other examples

NLCD over hillshade, in northern New Mexico (using blend.multiply): nlcd_hillshade

Elevation over slope, using blend.dodge (Grand Canyon): gc

License

The blend code is licensed under the terms of the MIT license.

gee-blend's People

Contributors

jessjaco 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.