当前位置:网站首页>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)
输出结果:
边栏推荐
- C exercise. Class list plus records, display records and clear records
- Tiktok practice ~ sharing module ~ short video download (save to photo album)
- (几何) 凸包问题
- Project practice 4: user login and token access verification (reids+jwt)
- Tree array
- 关于Qt数据库开发的一些冷知识
- MongoDB实现创建删除数据库、创建删除表(集合)、数据增删改查
- 问题解决:虚拟机无法复制粘贴文件
- 30. 串联所有单词的子串
- Flutter TextField详解
猜你喜欢
随机推荐
find_ path、find_ Library memo
Keep alive cache component in Vue
Uni app uses canvas to draw QR code
抖音实战~分享模块~复制短视频链接
[recommended collection] these 8 common missing value filling skills must be mastered
Basic and necessary common plug-ins of vscade
Can I open an account online? Is it safe?
Dynamic planning 111
IDEA 报错:Process terminated【已解决】
Analysis on development technology of NFT meta universe chain game system
Refresh the strong pointer assignment problem in the HP-UX system of Sanguan
515. find the maximum value in each tree row
[serialization] how to master the core technology of opengauss database? Secret 5: master database security (6)
Flutter TextField详解
Selection of database paradigm and main code
Boot指标监测
swagger:如何生成漂亮的静态文档说明页
C language file cursor fseek
Wechat applet uniapp left slide delete with Delete Icon
(几何) 凸包问题








