Copyright (c) 2019 Dongdong Kong, China University of Geosciences
Keep in mind that this repository is released under a GPL3 license, which permits commercial use but requires that the source code (of derivatives) is always open even if hosted as a web service.
[TOC]
This repository is a GEE package in JavaScript
. You can access it by
https://code.earthengine.google.com/?accept_repo=users/kongdd/public.
// Load package
var pkg_vis = require('users/kongdd/public:pkg_vis.js');
-
gradient legend,
pkg_vis.grad_legend(viz, title, IsPlot, position)
- viz Visualization parameters.
- position String, legend position, e.g. "bottom-left", "bottom-right".
- palette Corresponding colors.
-
discrete legend,
pkg_vis.discrete_legend(names, palette, title, IsPlot, position)
Legend examples: https://code.earthengine.google.com/c35e156e943370c1dd363732a5b59531.
-
Layout
layout
works likelayout
in R andsubplot
in MATLAB , which is used to produce multiple maps.
// load package
var pkg_smooth = require('users/kongdd/public:Math/pkg_smooth.js');
-
Linear interpolation,
pkg_smooth.linearInterp(imgcol, frame, nodata)
Example: https://code.earthengine.google.com/3b08f56a5f646104c742be584877e94e.
-
Historical average interpolation:
pkg_smooth.historyInterp(imgcol, imgcol_his_mean, prop, nodata)
Example: https://code.earthengine.google.com/3b08f56a5f646104c742be584877e94e.
-
wBisquare_array
Bisquare weights updating function
// Load package
var pkg_trend = require('users/kongdd/public:Math/pkg_trend.js');
-
aggregate_prop
: works likeaggregate
function in R .// add the property of Year, YearStr, YearMonth, Season imgcol = pkg_trend.imgcol_addSeasonProb(imgcol); imgcol_year = pkg_trend.aggregate_prop(imgcol, "year", 'mean'); pkg_trend.aggregate_prop(ImgCol, prop, reducer, delta)
-
linearTrend,
pkg_trend.linearTrend(ImgCol, robust)
// Load package
var pkg_export = require('users/kongdd/public:pkg_export.js');
If you need to download in batch, suggest combining with gee_monkey.
-
ExportImg
: Exportee.Image
in degree,pkg_export.ExportImg(img, task, options)
-
ExportImgCol
: Exportee.ImageCollection
in degree,pkg_export.ExportImgCol(ImgCol, dateList, options, prefix)
Show available palettes provided by pkg_vis
. This function is modified from Gena‘s package.
pkg_vis.showColors();