Skip to content

fsn1995/Fun-with-Google-Earth-Engine

Repository files navigation

HitCount

Fun with GEE

Google Earth Engine self-learning. Here is a collection of GEE javascript practice for myself.

Tools

Normalize images in imageCollection based on the minMax. One can access it by:

// import function
var imNormfunction = require('users/fsn1995/tool:imNormalization');
// apply
var imNormalized = imNormfunction.imNormalize(ImageCollection);

A temporary function to apply PCA to images in imageCollection. It only returns pc1-pc3 for now and will be updated later.

// import function
var imPCAfunction = require('users/fsn1995/tool:imPCA');
// apply PCA, bands are the selected bands to apply PCA
var imPCA = imPCAfunction.imPCA(ImageCollection,bands);

Exercises:

1. Mean Annual Temperature/Precipitation - Noah

2. GRACE

3. Visualization of Global Product

4. koppen climate classification

5. Trend Analysis

6. Urban landcover

7. Flood mapping

8. dem terrain calculator

This script computes, displays and exports the mean annual temperature, mean annual precipitation. The selected dateset is NOAH Global Land Assimulation System data.

This script displays the long term average GRACE (the Gravity Recovery and Climate Experiment) data.
screenshot

3. Visualization of Global Product

This part aims to visualize some of the global product in the GEE's dataset.

3.1 EC JRC/Google Global Product

Explore the global surface product provided by EC JRC/Google.

It would display the global surface water dynamics in your area of interest. screenshot

3.1.2 Global Water Time Slider

It creates a dateslider to check the monthly or annual water classification . screenshot

This script utizes the GHSL: Global Human Settlement Layers, Built-Up Grid 1975-1990-2000-2015 (P2016) data. screenshot

It displays the maximum extent of fire events during the study period at specified country. This was used to assist ICRC GIS officers from Lebanon to locate wildfires. The polygons of fire events can be exported via google drive.
The data is provided by NASA / LANCE / EOSDIS (FIRMS: Fire Information for Resource Management System)

This script displays The Köppen-Geiger climate map with a spatial resolution of 5 arc minutes for the period of 1986-2010. The legend will be displayed in the console.

This script performs Mann-kendall's test to the MODIS NDVI product. The result can be used to indicate the long-term trend of global vegetation (green) trend.
screenshot

A quick overview of the unsupervised classification with high resolution imagery (Planet Lab). screenshot

A tool to visualize flooded area and summarize the time series of area changes. A video of all the available sentinel 1 images can be exported to google drive.
screenshot

A simple practice of calculating terrain products (slope, aspect, hillshade) and export shapefile of different slope zones.

Python API

This is just a quick solution to batch upload via the command line tool. It creates a text file with the commands to upload images from google cloud storage bucket and the other text file for defining the timestamp of each image. You will need to install earthengine-api first. Note: Just discovered that each user can only upload maximum 10k images. Ref: https://developers.google.com/earth-engine/command_line

quick link

  1. AWESOME geetools by @author: Rodrigo E. Principe https://github.com/fitoprincipe/geetools-code-editor/wiki
  2. gee community: https://github.com/gee-community/
  3. how to add a legend? https://mygeoblog.com/2016/12/09/add-a-legend-to-to-your-gee-map/
  4. how to add a gradient legend? https://mygeoblog.com/2017/03/02/creating-a-gradient-legend/