Google Earth Engine(GEE)—geemap天气、植被数据可视化时间序列分析

2024-02-02 08:31:52 浏览数 (2)

代码语言:javascript复制
import ee
import geemap
# geemap.update_package()

天气数据可视化

代码语言:javascript复制
Map = geemap.Map()

collection = ee.ImageCollection('NOAA/GFS0P25') 
  .filterDate('2018-12-22', '2018-12-23') 
  .limit(24) 
  .select('temperature_2m_above_ground')#地表两米的降水量

vis_params = {
  'min': -40.0,
  'max': 35.0,
  'palette': ['blue', 'purple', 'cyan', 'green', 'yellow', 'red']
}

first_image = collection.first()

Map.addLayer(first_image, vis_params, "First image")
Map.setCenter(-0.3490, 25.7900, 2)
Map

image = collection.toBands()让波段去应用这些信息,
Map.addLayer(image, {}, "Time series", False)

labels = [str(n).zfill(2)   ":00" for n in range(0, 24)]
labels
#添加时间滑块来显示这些东西
Map.add_time_slider(collection, vis_params, labels=labels, time_interval=1)
Map

NDVI时序分析展示:

代码语言:javascript复制
Map = geemap.Map()

collection = ee.ImageCollection('MODIS/MCD43A4_006_NDVI') 
                  .filter(ee.Filter.date('2018-04-01', '2018-05-01')) 
                  .select("NDVI")

vis_params = {
  'min': 0.0,
  'max': 1.0,
  'palette': [
    'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
    '66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
    '012E01', '011D01', '011301'
  ],
}

first_image = collection.first()

Map.addLayer(first_image, vis_params, "First image")
Map.setCenter(-7.03125, 31.0529339857, 2)
Map

image = collection.toBands()对应的获取波段然后然波段应用到的图形展示中,但是这个没有设置视觉参数
Map.addLayer(image, {}, "Time series", False)

labels = collection.aggregate_array("system:index").getInfo()
#添加时间滑块来显示这些东西
Map.add_time_slider(collection, vis_params, labels=labels, time_interval=1)

可视化Landsat影像:

代码语言:javascript复制
Map = geemap.Map()

bands = ['B1', 'B2', 'B3', 'B4', 'B5', 'B7']
image = ee.Image('LE7_TOA_5YEAR/1999_2003').select(bands)
vis_params = {'min': 20, 'max': 200, 'gamma': 2.0}#这里的伽马函数一般是调节亮度的

Map.add_time_slider(image, vis_params, labels=bands, time_interval=1)

Map

0 人点赞