首页 > 其他分享 >GEE C16 Change Detection 变化检测

GEE C16 Change Detection 变化检测

时间:2024-03-19 11:35:13浏览次数:33  
标签:变化检测 diffClassified Map SR Detection preImage var addLayer Change

导读:

1. 创建和探索如何读取一个假彩色无云的Landsat合成影像;

2.计算归一化燃烧指数;

3.定位变化的区域;

4.生成变更图并使用阈值对变更进行分类。

一、准备影像

1.1 select 用法

 1.2 多时相配准、辐射大气校正

这里用的LANDSAT/LC08/C02/T1_L2数据集。

 

二、创建假彩色合成影像

var visParam = { 'bands': ['swir2', 'nir', 'red'], 
    'min': 7750, 
    'max': 22200 
}; 
Map.addLayer(preImage, visParam, 'pre'); 
Map.addLayer(postImage, visParam, 'post'); 

Q: 调色板中的'min' 和'max'参数的值是怎么确定的?

 

三、代码

//----------------------------Section 1 ------------------------------------
var landsat8 = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
    .select( ['SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B6', 'SR_B7'], 
    ['blue', 'green', 'red', 'nir', 'swir1', 'swir2'] ); 
    

var point = ee.Geometry.Point([-123.64, 42.96]); 
Map.centerObject(point, 11); 

var preImage = landsat8.filterBounds(point) 
    .filterDate('2013-06-01', '2013-06-30') 
    .sort('CLOUD_COVER', true) 
    .first(); 
print('preImage',preImage);

 
var postImage = landsat8.filterBounds(point)
    .filterDate('2020-06-01', '2020-06-30') 
    .sort('CLOUD_COVER', true) 
    .first(); 
print('postImage', postImage);

//----------------------------Section 2 ------------------------------------
var visParam = { 'bands': ['swir2', 'nir', 'red'], 
    'min': 7750, 
    'max': 22200 
}; 
Map.addLayer(preImage, visParam, 'pre'); 
Map.addLayer(postImage, visParam, 'post'); 

//----------------------------Section 3 计算NBR------------------------------------
// Calculate NBR. 
var nbrPre = preImage.normalizedDifference(['nir', 'swir2']) .rename('nbr_pre'); 
var nbrPost = postImage.normalizedDifference(['nir', 'swir2']) .rename('nbr_post');

//----------------------------Section 4 Single Date Transformation------------------------------------
// 2-date change. 
var diff = nbrPost.subtract(nbrPre).rename('change'); 
var palette = [ 
    '011959', '0E365E', '1D5561', '3E6C55', '687B3E', '9B882E', 'D59448', 'F9A380', 'FDB7BD', 'FACCFA' 
]; 
var visParams = { 
    palette: palette, 
    min: -0.2, 
    max: 0.2 
}; 
Map.addLayer(diff, visParams, 'change'); 


//----------------------------Section 5 lassify change --------------------------------------
var thresholdGain = 0.10; 
var thresholdLoss = -0.10; 
var diffClassified = ee.Image(0); 
diffClassified = diffClassified.where(diff.lte(thresholdLoss), 2); 
diffClassified = diffClassified.where(diff.gte(thresholdGain), 1); 
print('diffClassified', diffClassified);
var changeVis = { 
    palette: 'fcffc8,2659eb,fa1373', 
    min: 0, 
    max: 2 
}; 
Map.addLayer(diffClassified.selfMask(), changeVis, 'change classified by threshold');

 

标签:变化检测,diffClassified,Map,SR,Detection,preImage,var,addLayer,Change
From: https://www.cnblogs.com/bltstop/p/18082392

相关文章

  • Exchange 2016卸载重新安装或更换电脑安装首次登录报错
    1、报错代码如下X-OWA-ErrorMicrosoft.Exchange.Data.Storage.ObjectNotFoundException2、解决方法2.1登录安装Exchange服务器,打开ExchangeManagementShell输入以下命令Get-Mailbox 2.2显示数据库异常,输入以下命令查看数据库和重新连接数据库Get-MailboxD......
  • Paper Content Similarity Detection
    PaperContentSimilarityDetectiongitcode项目地址:https://gitcode.com/2301_78305256/PaperContentSimilarityDetection/tree/masterPSP表格PSP2.1PersonalSoftwareProcessStages预估耗时(分钟)实际耗时(分钟)Planning计划2020·Estimate·估计这个任......
  • 12-Collision_Detection
    COLLISIONDETECTIONPIPELINECollisiondetectioncanbeaverytime-consumingprocess.Fortunatelythereisplentyofroomforimprovement.Thetwokeyproblems—havingtoomanypossiblecollisionsandhavingexpensivechecks—haveindependentsolutions.T......
  • CYQ.Data 操作 Redis 性能测试:对比 StackExchange.Redis
    前言:前几天,点开自己的博客,看了一下CYQ.DataV5系列 都有哪些文章,发现了一篇2019年写的:CYQ.Data对于分布式缓存Redis、MemCache高可用的改进及性能测试,于是点进去看了看。感觉文章中有些表述存有问题,不过不是重点。重点,看了里面的测试结论,如果四五年过去了,CYQ.Data 低调的......
  • JS 监听浏览器各个标签间的切换-visibilitychange事件介绍
    文章目录一、JS监听浏览器各个标签间的切换二、document的可见性属性三、示例:监听标签,控制视频播放与暂停一、JS监听浏览器各个标签间的切换以前看到过一些网页,在标签切换到其它地址时,网页上的标题上会发生变化,一直不知道这个是怎么做的,最近查了一些资料才发现......
  • wpf datagrid row background color alternatively changed based on row index,Alter
    <Windowx:Class="WpfApp7.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.c......
  • 修改生产订单组件——CO_XT_COMPONENT_CHANGE
    转载地址https://www.cnblogs.com/StephenAmell/p/16742366.html 修改组件仓库的范例DATA:lv_poTYPEcoxt_ord_key,ls_componentTYPEcoxt_s_ord_comp_key,ls_requTYPEcoxt_s_quantity,ls_requxTYPEcoxt_s_quantityx,ls......
  • 初中英语优秀范文100篇-100Confidence has changed me-自信改变了我
    PDF格式公众号回复关键字:SHCZFW100记忆树1RecentlyI’vehadachangeinmylife.翻译最近我的生活发生了一些变化简化记忆变化句子结构时间状语“Recently”修饰整个句子,表示动作发生的时间主语I,谓语’vehad,宾语achange,介词短语“inmylife”进一步描述了......
  • 在 Exchange Server 中配置特定于客户端的消息大小限制
    微软官方详细文档如下:https://learn.microsoft.com/zh-cn/exchange/architecture/client-access/client-message-size-limits?view=exchserver-2019解决方法:通过查看官方文档,打开cmd复制执行下面%windir%的部分命令,重新IIS服务,问题解决。注:下面的数值表示200MBActiveSync%E......
  • Five Key Changes Coming With DDR5 DIMMs
    https://semiengineering.com/five-key-changes-coming-with-ddr5-dimms/OnJuly14thoflastyear,JEDECannouncedthepublicationoftheDDR5SDRAMstandard.ThissignaledthenearingindustrytransitiontoDDR5serverdual-inlinememorymodules(DIMM).DDR......