美文网首页GEE案例
GEE灯光数据趋势分析

GEE灯光数据趋势分析

作者: 赤豆冰棍 | 来源:发表于2019-01-07 02:22 被阅读0次

计算DMSP灯光数据的趋势

主要功能

获取1990年以来的灯光数据,

代码

// Compute the trend of nighttime lights from DMSP.

// Add a band containing image date as years since 1990.
function createTimeBand(img) {
  var year = img.date().difference(ee.Date('1990-01-01'), 'year');
  return ee.Image(year).float().addBands(img);
}

// Fit a linear trend to the nighttime lights collection.
var collection = ee.ImageCollection('NOAA/DMSP-OLS/CALIBRATED_LIGHTS_V4')
    .select('avg_vis')
    .map(createTimeBand);
var fit = collection.reduce(ee.Reducer.linearFit());

// Display a single image
Map.addLayer(ee.Image(collection.select('avg_vis').first()),
         {min: 0, max: 63},
         'stable lights first asset');

// Display trend in red/blue, brightness in green.
Map.setCenter(30, 45, 4);
Map.addLayer(fit,
         {min: 0, max: [0.18, 20, -0.18], bands: ['scale', 'offset', 'scale']},
         'stable lights trend');

步骤分析

  1. 定义函数,生成时序波段
  2. 生成数据集对象,选择灯光数据
  3. 计算灯光数据变化趋势
  4. 添加变化趋势最大结果
  5. 设置地图中心,缩放等级
  6. 添加图层

主要方法

  1. ee.Image.date()
    Returns the acquisition time of an image as a Date object. This helper function is equivalent to ee.Date(image.get('system:time_start')).
    Arguments:
    this:image (Image):
    The image whose acquisition time to return.
    Returns: Date

以对象形式返回指定的影像数据。
输入参数:输入影像对象

  1. ee.Date.difference()
    Returns the difference between two Dates in the specified units; the result is floating-point and based on the average length of the unit.
    Arguments:
    this:date (Date)
    start (Date)
    unit (String):
    One of 'year', 'month' 'week', 'day', 'hour', 'minute', or 'second'.
    Returns: Float

返回两个输入时间间的差值,使用指定的单位,返回结果是浮点型的。
输入参数:输入时间对象,开始(时间对象),单位(字符串)

  1. ee.ImageCollection.map()
    Maps an algorithm over a collection.
    Returns the mapped collection.
    Arguments:
    this:collection (Collection):
    The Collection instance.
    algorithm (Function):
    The operation to map over the images or features of the collection. A JavaScript function that receives an image or features and returns one. The function is called only once and the result is captured as a description, so it cannot perform imperative operations or rely on external state.
    dropNulls (Boolean, optional):
    If true, the mapped algorithm is allowed to return nulls, and the elements for which it returns nulls will be dropped.
    Returns: Collection

在数据集内的所有数据上执行指定函数。
输入参数:输入数据集对象,算法(指定的函数),是否允许返回NULL(布尔型)

  1. ee.ImageCollection.reduce()
    Applies a reducer across all of the images in a collection.
    If the reducer has a single input, it will be applied separately to each band of the collection; otherwise it must have the same number of inputs as the collection has bands.
    The reducer output names determine the names of the output bands: reducers with multiple inputs will use the output names directly, while reducers with a single input will prefix the output name with the input band name (e.g. '10_mean', '20_mean', etc.).
    Arguments:
    this:collection (ImageCollection):
    The image collection to reduce.
    reducer (Reducer):
    The reducer to apply to the given collection.
    parallelScale (Float, default: 1):
    A scaling factor used to limit memory use; using a larger parallelScale (e.g. 2 or 4) may enable computations that run out of memory with the default.
    Returns: Image

对数据集中的所有数据应用一个reducer。如果reducer只需要一个数据,则对每一个数据都执行该操作;否则,必须与数据集中数据个数相同的输入参数个数。
输入参数:数据集对象,reducer,并行尺度(限制内存使用量)

  1. ee.Reducer.linearFit()
    Returns a Reducer that computes the slope and offset for a (weighted) linear regression of 2 inputs.
    No arguments.
    Returns: Reducer

返回一个reduce对象,用于计算坡度和加权的偏移量

相关文章

  • GEE灯光数据趋势分析

    计算DMSP灯光数据的趋势 主要功能 获取1990年以来的灯光数据, 代码 步骤分析 定义函数,生成时序波段 生成...

  • EZ | Get Help | GEE - 06

    Get Help GEE的教程和开发文档旨在帮助用户开始常规分析,但学习使用GEE做一些特定的分析任务就不太容易了...

  • GEE学习笔记 一

    初识GEE GEE简介GEE应用范围GEE优缺点GEE初识 1.GEE是什么? GEE(全称Google Eart...

  • GEE学习笔记 零

    GEE初识 GEE示例以及学习资源介绍 GEE工作台介绍 GEE资源查找 GEE资源上传 GEE资源导出 GEE控...

  • 成都大数据培训,大数据分析未来趋势

    大数据这么火,未来趋势这么明朗,今天就带大家来分析一下大数据分析未来趋势是什么。 当前的数据分析技术的研究可以分为...

  • GEE学习笔记 八

    GEE的基本数据类型和语法介绍 这里罗列一些和JavaScript对应的GEE常见的数据类型,不包括Image、F...

  • 基于matlab 的长时间栅格数据的sen趋势分析

    基于matlab 的长时间栅格数据的sen趋势分析 sen趋势分析是进行趋势分析的方法之一,常配合MK检验来使用,...

  • 数据分析

    数据分析基本方法 对比分析(横向对比纵向对比) 趋势分析 象限分析 交叉分析 数据分析框架_AARRR分析 逻辑分...

  • 英国零售商销售分析

    目录一. 项目背景二. 数据探索三. 数据清洗四. 数据分析1. 消费趋势分析2. 用户行为分析3. 用户分类 (...

  • 描述性统计分析之离中趋势分析

    描述性统计分析之离中趋势分析 离中趋势是指一组数据中各数据值以不同程度的距离偏离其中心(平均数)的趋势,又称标志变...

网友评论

    本文标题:GEE灯光数据趋势分析

    本文链接:https://www.haomeiwen.com/subject/pzirrqtx.html