当前位置:网站首页>GEE:计算image区域内像素最大最小值
GEE:计算image区域内像素最大最小值
2022-06-26 20:13:00 【BetterQ.】
GEE:计算image区域内像素最大最小值
使用GEE统计指定区域内像素的最大最小值(如DEM)时,需要使用到GEE中的.regionReducer和reducer函数。
min & max
最大值:ee.Reducer.max()
最小值:ee.Reducer.min()
最大最小值:ee.Reducer.minMax()
代码实现
最大值
//给定区域
var CQ =
/* color: #98ff00 */
/* shown: false */
ee.Geometry.Polygon(
[[[107.81231551184783, 29.581711188146137],
[108.25176863684783, 30.49472925792531],
[110.00958113684783, 31.173930341237376],
[108.60333113684783, 31.922923346675326],
[106.84551863684783, 30.418966567079185],
[105.35137801184783, 30.418966567079185],
[105.35137801184783, 29.428726935782418],
[107.10919051184783, 28.89146956313381]]]);
//选择数据集,这里选择DEM
var DEM=ee.Image("CGIAR/SRTM90_V4");
//统计最大值
var max=DEM.reduceRegion({
reducer:ee.Reducer.max(),
geometry:CQ,
scale:90
});
print(max)
输出结果:
最小值
//给定区域
var CQ =
/* color: #98ff00 */
/* shown: false */
ee.Geometry.Polygon(
[[[107.81231551184783, 29.581711188146137],
[108.25176863684783, 30.49472925792531],
[110.00958113684783, 31.173930341237376],
[108.60333113684783, 31.922923346675326],
[106.84551863684783, 30.418966567079185],
[105.35137801184783, 30.418966567079185],
[105.35137801184783, 29.428726935782418],
[107.10919051184783, 28.89146956313381]]]);
//选择数据集,这里选择DEM
var DEM=ee.Image("CGIAR/SRTM90_V4");
//统计最大值
var min=DEM.reduceRegion({
reducer:ee.Reducer.min(),
geometry:CQ,
scale:90
});
print(min)
输出结果:
同时计算最大最小值
可以同时获取区域像素的最大最值,如下:
//给定区域
var CQ =
/* color: #98ff00 */
/* shown: false */
ee.Geometry.Polygon(
[[[107.81231551184783, 29.581711188146137],
[108.25176863684783, 30.49472925792531],
[110.00958113684783, 31.173930341237376],
[108.60333113684783, 31.922923346675326],
[106.84551863684783, 30.418966567079185],
[105.35137801184783, 30.418966567079185],
[105.35137801184783, 29.428726935782418],
[107.10919051184783, 28.89146956313381]]]);
//选择数据集,这里选择DEM
var DEM=ee.Image("CGIAR/SRTM90_V4");
var maxmin=DEM.reduceRegion({
reducer:ee.Reducer.minMax(),
geometry:CQ,
scale:90
});
print(maxmin)
输出结果:
边栏推荐
- Résolution du problème: la machine virtuelle n'a pas pu copier et coller le fichier
- Kubernetes 资源拓扑感知调度优化
- Tiktok practice ~ search page ~ video details
- Garbage collection mechanism of browser
- The king of Internet of things protocol: mqtt
- 抖音实战~搜索页面~视频详情
- Unity - URP get camera stack
- uni-app使用canvas绘制二维码
- Super VRT
- 抖音实战~分享模块~生成短视频二维码
猜你喜欢

Flutter TextField详解

Selection of database paradigm and main code

Basic and necessary common plug-ins of vscade

Project practice 4: user login and token access verification (reids+jwt)

Dynamic planning 111

MySQL - database creation and management

Feign远程调用

Wechat applet uniapp left slide delete with Delete Icon

Feitian +cipu body brings more imagination to the metauniverse

Unity——Mathf. Similarities and differences between atan and atan2
随机推荐
Developer survey: rust/postgresql is the most popular, and PHP salary is low
C language file cursor fseek
西瓜书重温(七): 贝叶斯分类器(手推+代码demo)
Disruptor本地线程队列_使用transProcessor处理器和WorkPool两种方式进行消费对比---线程间通信工作笔记005
710. random numbers in the blacklist
Boot indicator monitoring
抖音实战~分享模块~复制短视频链接
c语言简单的登录
Installation and use of filebeat
Project practice 5: build elk log collection system
Good thing recommendation: mobile terminal development security tool
网上办理中金财富开户安全吗?
Serial port application program based on gd32
Summary of several common UML diagrams
問題解决:虛擬機無法複制粘貼文件
Feitian +cipu body brings more imagination to the metauniverse
网上开户万一免五到底安不安全?
Is it safe to open an account for CICC Wealth Online?
抖音实战~首页视频~下拉刷新
Feign远程调用