代码编织梦想

我正在使用 Landsat 图像估算水库的存储容量。我有可用的代码…但问题是当我尝试为我的研究区域运行该代码时,它不显示任何图像。这里的问题:
并没有任何影像集合是因为没有时间属性
函数:
intersection(other)
Returns a DateRange that contains all points in the intersection of this DateRange and another.

Arguments:
this:dateRange (DateRange)
other (DateRange)
Returns: DateRange

ee.Image.pixelArea()
Generate an image in which the value of each pixel is the area of that pixel in square meters. The returned image has a single band called “area.”

No arguments.
Returns: Image

reduceRegion(reducer, geometry, scale, crs, crsTransform, bestEffort, maxPixels, tileScale)
Apply a reducer to all the pixels in a specific region.

Either the reducer must have the same number of inputs as the input image has bands, or it must have a single input and will be repeated for each band.

Returns a dictionary of the reducer’s outputs.

Arguments:
this:image (Image):
The image to reduce.

reducer (Reducer):
The reducer to apply.

geometry (Geometry, default: null):
The region over which to reduce data. Defaults to the footprint of the image’s first band.

scale (Float, default: null):
A nominal scale in meters of the projection to work in.

crs (Projection, default: null):
The projection to work in. If unspecified, the projection of the image’s first band is used. If specified in addition to scale, rescaled to the specified scale.

crsTransform (List, default: null):
The list of CRS transform values. This is a row-major ordering of the 3x2 transform matrix. This option is mutually exclusive with ‘scale’, and replaces any transform already set on the projection.

bestEffort (Boolean, default: false):
If the polygon would contain too many pixels at the given scale, compute and use a larger scale which would allow the operation to succeed.

maxPixels (Long, default: 10000000):
The maximum number of pixels to reduce.

tileScale (Float, default: 1):
A scaling factor between 0.1 and 16 used to adjust aggregation tile size; setting a larger tileScale (e.g. 2 or 4) uses smaller tiles and may enable computations that run out of memory with the default.

Returns: Dictionary

ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty)
Generates a Chart from an ImageCollection. Plots derived values of each band in a region across images. Usually a time series.

X-axis: Image, labeled by xProperty value.

Y-axis: Band value.

Series: Band names.

Returns a chart.

Arguments:
imageCollection (ImageCollection):
An ImageCollection with data to be included in the chart.

region (Feature|FeatureCollection|Geometry):
The region to reduce.

reducer (Reducer, optional):
Reducer that generates the values for the y-axis. Must return a single value. Defaults to ee.Reducer.mean().

scale (Number, optional):
Scale to use with the reducer in meters.

xProperty (String, optional):
Property to be used as the label for each image on the x-axis. Defaults to ‘system:time_start’.

Returns: ui.Chart

var albufeira = ee.FeatureCollection("users/bqt2000204051/huodong");
/// JAVASCRIPT CODE DEVELOPED 
// Monitoring the storage volume of water reservoirs using Google Earth Engine /
// Joaquim Condeça, João Nascimento and Nuno Barreiras /
///WATER AREA(m2) FOR ALVITO, CAIA, MARANHÃO AND ROXO RESERVOIRES - LANDSAT 4,5 e 8/
///EXEMPLE FOR MNDWI, XU,2006///
// NDWI = (green - mir) / (green + mir)/
// green: Banda B2   //
// mir:   Banda B5  //
/ THE var albufeira must be include as Assets (shapefile geometry of the reservoirs)


/// BEGIN Functions cloudMaskL457 and maskL8sr ///
/// Functions to mask clouds based on the pixel_qa band of Landsat SR data
/// SOURCE: https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT05_C01_T1_SR#bands
/// The recommendation is the use of two functions (cloudMaskL457, for Landsat 4 and 5 images, and maskL8sr, for Landsat 8 images), 
/// which use the “pixel_qa” band of Landsat SR images to mask the clouds (GEE, 2020).
/// pixel_qa -> Pixel quality attributes generated from the CFMASK algorithm.

var cloudMaskL457 = function(image) {
   
  var qa = image.select('pixel_qa');
  // If the cloud bit (5) is set and the cloud confidence (7) is high
  // or the cloud shadow bit is set (3), then it's a bad pixel.
  var cloud = qa.bitwiseAnd(1 << 5)
                  .and(qa.bitwiseAnd(1 << 7))
                  .or(qa.bitwiseAnd(1 << 3));
  // Remove edge pixels that don't occur in all bands
  var mask2 = image.mask().reduce(ee.Reducer.min());
  return image.updateMask(cloud.not()).updateMask(mask2);
};

/**
 * Function to mask clouds based on the pixel_qa band of Landsat 8 SR data.
 * @param {ee.Image} image input Landsat 8 SR image
 * @return {ee.Image} cloudmasked Landsat 8 image
 */
function maskL8sr(image) {
   
  // Bits 3 and 5 are cloud shadow and cloud, respectively.
  var cloudShadowBitMask = (1 << 3);
  var cloudsBitMask = (1 << 5);
  // Get the pixel QA band.
  var qa = image.select('pixel_qa');
  // Both flags should be set to zero, indicating clear conditions.
  var mask = qa.bitwiseAnd(cloudShadowBitMask).eq(0)
                 .and(qa.bitwiseAnd(cloudsBitMask).eq(0));
  return image.updateMask(mask);
}

/// END
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_31988139/article/details/130592083

GEEer成长日记十九:使用Landsat 8影像计算水体指数NDWI、MNDWI并下载到本地-爱代码爱编程

目录 一、NDWI和MNDWI计算公式介绍 1、NDWI(归一化差异水体指数) 2、MNDWI(改进的归一化差异水体指数) 二、使用Landsat8影像计算NDWI和MNDWI 1、获取Landsat8影像 2、计算NDWI 3、计算MNDWI 三、结果导出 1、导出NDWI 2、导出MNDWI 一、NDWI和MNDWI计算公式介

易康ecognition9.0分类|规则集和机器学习的方法的面向对象的多尺度分割分类_昆齐的博客-爱代码爱编程

前言:因为第一次接触,所以非常非常细致,,  第一步:File—new project:(新建一个project,可以保存)    第二步:选择影像(注意路径一定纯英文) 第三步:双击修改波段名称,方便后续计算 第四步:修改波段显示:按需求进行波段组合,还可以进行显示拉伸  

【envi入门系列】15.遥感动态监测_地理探险家的博客-爱代码爱编程

【ENVI入门系列】15.遥感动态监测 目录 遥感动态监测 动态检测概述ENVI中的动态检测工具详细操作步骤 3.1 图像直接比较法 3.2 分类后比较法 3.3 流程化动态监测工具 3.3.1 Image Change

google earth engine(gee)——10分钟短文快速了解地球引擎和森林面积损失计算_此星光明的博客-爱代码爱编程

1. 了解什么是 Google 地球引擎 正如其开发人员所描述的那样,Google Earth Engine 是“世界上最先进的基于云的地理空间处理平台!” 这意味着,通过 Google Earth Engine,您可以访问并高效分析众多开源空间数据库(如 Landsat 和 MODIS 遥感图像、全球森林变化数据集、道路、保护区等)。在进行这些分析时,

遥感数字图像处理(复习)-爱代码爱编程

文章目录 绪论数字图像处理的概念数字图像的表示方法数字图像处理的三个层次数字图像处理的主要研究内容 数字图像基础图像与数字图像数字图像获取时的基本参数数字图像特性数字图像输出时的基本参数数字图像种类数字图

google earth engine(gee)—— 超限超时提取的问题(besteffort的适用)_tilescale最大取多少-爱代码爱编程

当您有超过 10000000 个像素时,bestEffort 参数将仅使用像素子集来计算统计信息。如果您想要实际的最小值/最大值,请将 maxPixels 设置为更高的数字使用图层管理器​​计算的参数是使用您所在缩放级别的地图中可见像素的子集完成的。 ( 参考)。可以得到近似的最小值/最大值如果您想要实际的最小/最大值,则需要以原始比例(30m)为整个几何

google earth engine(gee)——求指定区域的ndvi时序变化和不同值域范围内的像素数量及其面积_gee筛选影像在某一值域内的像素-爱代码爱编程

本程序原理很简单,主要就是选定指定的研究区进行NDVI6-8年的时序分析,并求出指定时序范围内的的值。当然再计算每月的过程中,我们肯定会用到map循环遍历每一年月份的图表,通过使用linearfit来计算斜率,通过选择指定阈值范围内的斜率来计算不同范围内的像素值。这里可以差异化加载不同阈值范围内的影像,也就是分段表示不同颜色。 这里再设定图表的时候,我们

通过像素点计算不规则图形面积_根据像素点计算凹陷图形面积-爱代码爱编程

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、BMP图片格式二、代码 前言 大学同学问:怎么求不规则图形面积?当时在想把一个图形看成一个一个点,

一、vue3基础[常用的循环]-爱代码爱编程

一、循环 1. filter 解释:filter 方法会创建一个新的数组,其中包含满足指定条件的所有元素。这个方法非常适合循环遍历数组并根据特定条件过滤元素的情况。例如,可以使用 filter 方法来找出数组中所有大于特

什么是js,js的特点,js的组成-爱代码爱编程

文章目录 一、什么是JavaScript?二、JavaScript的特点三、JavaScript的组成 一、什么是JavaScript? JavaScript是一种高级的脚本编程语言,通常用于网页开

java基于ssm的校内信息服务发布系统的设计与实现+vue论文-爱代码爱编程

校内信息服务发布系统的设计与实现 摘要 近年来,信息化管理行业的不断兴起,使得人们的日常生活越来越离不开计算机和互联网技术。首先,根据收集到的用户需求分析,对设计系统有一个初步的认识与了解,确定校内信息服务发布系统的总体功

three.js实现扩散光圈效果-爱代码爱编程

three.js实现扩散光圈效果 图例 步骤 创建一个平面,添加纹理贴图缩放 代码 <template> <div class="app"> <div ref="can