当前位置:网站首页>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)
输出结果:
边栏推荐
- Wechat applet custom pop-up components
- 8VC Venture Cup 2017 - Final Round C. Nikita and stack
- C primer plus学习笔记 —— 3、字符的IO(输入/输出)
- 威胁猎人必备的六个威胁追踪工具
- 30. concatenate substrings of all words
- Detailed explanation of stored procedures in MySQL
- 慕课8、服务容错-Sentinel
- Why don't I recommend going to sap training institution for training?
- The king of Internet of things protocol: mqtt
- 2022/02/14 line generation
猜你喜欢
c语言99乘法表
Refresh the strong pointer assignment problem in the HP-UX system of Sanguan
Disruptor本地线程队列_使用transProcessor处理器和WorkPool两种方式进行消费对比---线程间通信工作笔记005
数据库范式和主码的选择
回溯思路详解
Tiktok practice ~ search page ~ scan QR code
Selection of database paradigm and main code
Mongodb implements creating and deleting databases, creating and deleting tables (sets), and adding, deleting, modifying, and querying data
Kubernetes resource topology aware scheduling optimization
关于不等式取值转义的思路
随机推荐
mysql的充值问题
【最详细】最新最全Redis面试大全(70道)
抖音实战~分享模块~短视频下载(保存到相册)
Development of NFT for digital collection platform
Installation and use of filebeat
Tree array
0基础c语言(0)
Invocation failed Unexpected end of file from server
C语言 文件光标 fseek
Six necessary threat tracking tools for threat hunters
[recommended collection] these 8 common missing value filling skills must be mastered
Serial port application program based on gd32
MongoDB实现创建删除数据库、创建删除表(集合)、数据增删改查
Summary of several common UML diagrams
两个文件 合并为第三个文件 。
C primer plus learning notes - 3. Character IO (input / output)
【最详细】最新最全Redis面试大全(42道)
开发者调查:Rust/PostgreSQL 最受喜爱,PHP 薪水偏低
Request method 'POST' not supported
好物推薦:移動端開發安全工具