使用geemap进行全球土地覆盖数据可视化与分析

发布时间:2026/8/23 16:29:52
使用geemap进行全球土地覆盖数据可视化与分析 使用geemap进行全球土地覆盖数据可视化与分析【免费下载链接】geemapA Python package for interactive geospatial analysis and visualization with Google Earth Engine.项目地址: https://gitcode.com/gh_mirrors/ge/geemap前言geemap是一个基于Google Earth Engine (GEE)的Python库它提供了丰富的功能来简化GEE数据的使用和分析。本文将重点介绍如何使用geemap对全球土地覆盖数据进行可视化和分析。准备工作安装geemap首先需要安装geemap库pip install geemap导入必要的库import ee import geemap初始化GEEgeemap.ee_initialize()可视化全球土地覆盖数据创建Dynamic World土地覆盖合成图Dynamic World是一个近实时的全球土地覆盖数据集提供9种土地覆盖类型的高分辨率分类。# 创建地图 Map geemap.Map() Map.add_basemap(HYBRID) # 设置感兴趣区域 region ee.Geometry.BBox(-89.7088, 42.9006, -89.0647, 43.2167) Map.centerObject(region) # 设置日期范围 start_date 2021-01-01 end_date 2022-01-01 # 创建Dynamic World土地覆盖合成图 landcover geemap.dynamic_world(region, start_date, end_date, clipTrue, return_typeclass) # 定义可视化参数 dwVisParams { min: 0, max: 8, palette: [ #419BDF, # 水体 #397D49, # 树木 #88B053, # 草地 #7A87C6, # 湿地 #E49635, # 建筑 #DFC35A, # 裸地 #C4281B, # 农田 #A59B8F, # 冰雪 #B39FE1, # 云层 ], } # 添加图层 Map.addLayer(landcover, dwVisParams, Land Cover Class) Map.add_legend(titleDynamic World Land Cover, builtin_legendDynamic_World) Map比较不同全球土地覆盖数据集ESA全球土地覆盖数据ESA WorldCover提供10米分辨率的全球土地覆盖数据。Map geemap.Map() esa ee.ImageCollection(ESA/WorldCover/v200).first() esa_vis {bands: [Map]} Map.addLayer(esa, esa_vis, ESA LC 2021) Map.add_legend(titleESA Land Cover, builtin_legendESA_WorldCover) MapESRI全球土地覆盖数据ESRI提供10米分辨率的全球土地覆盖时间序列数据。Map geemap.Map() esri ee.ImageCollection(projects/sat-io/open-datasets/landcover/ESRI_Global-LULC_10m_TS).filterDate(start_date, end_date).mosaic() esri_vis { min: 1, max: 11, palette: [ #1A5BAB, # 水体 #358221, # 树木 #000000, # 草地 #87D19E, # 湿地 #FFDB5C, # 农田 #000000, # 灌木 #ED022A, # 建筑 #EDE9E4, # 裸地 #F2FAFF, # 冰雪 #C8C8C8, # 云层 #C6AD8D, # 其他 ], } Map.addLayer(esri, esri_vis, ESRI LC 2021) Map.add_legend(titleESRI Land Cover, builtin_legendESRI_LandCover_TS) Map创建Dynamic World时间序列Map geemap.Map() Map.add_basemap(HYBRID) # 设置时间范围 start_date 2017-01-01 end_date 2023-01-01 # 创建时间序列 images geemap.dynamic_world_timeseries(region, start_date, end_date, frequencyyear, return_typeclass) # 添加时间序列检查器 Map.ts_inspector(images, left_visdwVisParams, date_formatYYYY) Map.add_legend(titleDynamic World Land Cover, builtin_legendDynamic_World) Map分析全球土地覆盖数据计算各类土地覆盖面积# 计算ESA土地覆盖各类型面积 df geemap.image_area_by_group( esa, scale1000, denominator1e6, decimal_places4, verboseTrue ) # 添加类别名称 esa_dict { 10 Trees: 006400, 20 Shrubland: ffbb22, 30 Grassland: ffff4c, 40 Cropland: f096ff, 50 Built-up: fa0000, 60 Barren / sparse vegetation: b4b4b4, 70 Snow and ice: f0f0f0, 80 Open water: 0064c8, 90 Herbaceous wetland: 0096a0, 95 Mangroves: 00cf75, 100 Moss and lichen: fae6a0, } df[class] list(esa_dict.keys()) # 绘制柱状图 geemap.bar_chart( df, xclass, yarea, x_labelLand Cover Type, y_labelArea (km2), ) # 绘制饼图 geemap.pie_chart(df, namesclass, valuesarea, height500)按国家统计土地覆盖数据# 加载国家边界数据 countries ee.FeatureCollection(geemap.examples.get_ee_path(countries)) Map.addLayer(countries, {}, Countries) # 按国家统计土地覆盖数据 geemap.zonal_stats_by_group( esa, countries, esa_2021_country.csv, stat_typeSUM, denominator1e6, scale1000, ) # 可视化各国森林面积 geemap.bar_chart( esa_2021_country.csv, xNAME, yClass_10, max_rows30, x_labelCountry, y_labelForest Area (km2), )总结本文介绍了如何使用geemap对全球土地覆盖数据进行可视化和分析包括可视化Dynamic World、ESA和ESRI等不同来源的土地覆盖数据创建土地覆盖时间序列动画计算各类土地覆盖的面积按国家统计土地覆盖数据并可视化geemap提供了简单易用的接口使得在Python环境中处理GEE数据变得更加高效和便捷。通过这些工具研究人员可以更轻松地进行全球土地覆盖变化的监测和分析。【免费下载链接】geemapA Python package for interactive geospatial analysis and visualization with Google Earth Engine.项目地址: https://gitcode.com/gh_mirrors/ge/geemap创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考