当前位置:网站首页>Gee: explore the change of water area in the North Canal basin over the past 30 years [year by year]
Gee: explore the change of water area in the North Canal basin over the past 30 years [year by year]
2022-07-02 05:11:00 【Gee water ecological space】
Catalog
Preface
Use GEE Analyze the change characteristics of water area in the basin , Take the North Canal basin as an example
For the same area analysis, see :
GEE: Reclassification of land use in the North Canal basin
The analysis area is as follows :
One 、 Analysis steps
Main analysis steps :
Two 、python Code
1、 Load watershed range
python The code is as follows
# Add display underlay , Select Gaode map
Map = geemap.Map()
Map.add_basemap('HYBRID')
# Import watershed range
basin_shp = '../world_basins/byh.shp'
basin_bj = geemap.shp_to_ee(basin_shp)
roi = basin_bj.geometry()
# Add display
Map.addLayer(ee.Image().paint(roi, 0, 2), {
'palette':'red'}, 'roi')
Map.centerObject(basin_bj)
Map
give the result as follows :
2、 Image capture and synthesis
- geemap.landsat_timeseries()
python The code is as follows :
# Import image data , Annual synthesis
images = geemap.landsat_timeseries(roi=roi,
start_year=1984,
end_year=2020,
start_date='01-01',
end_date='12-31')
# Check the image band
first = images.first()
first.bandNames().getInfo()
# ['Blue', 'Green', 'Red', 'NIR', 'SWIR1', 'SWIR2', 'pixel_qa', 'NBR']
# Add display
Map.addLayer(first, {
'bands':['SWIR2', 'SWIR1', 'Green'], 'min':0, 'max':3000}, 'first image')
give the result as follows :
3、NDWI Calculation and water surface extraction
normalizedDifference()
ee.Image.pixelArea()
- ee.Image.reduceRegion()
python The code is as follows :
def ndwi_cac(image):
ndwi_image = image.normalizedDifference(['Green', 'SWIR1']).rename('ndwi')
return ndwi_image.gt(0).selfMask()
# Get water surface
ndwi_water = images.map(ndwi_cac)
Map.addLayer(ndwi_water.first(), {
'palette':'blue'}, 'first water')
# Calculate the water surface area , The unit is according to km2 meter
def cal_area(image):
pixel_area = image.multiply(ee.Image.pixelArea()).divide(1e6)
img_area = pixel_area.reduceRegion(**{
'reducer':ee.Reducer.sum(),
'geometry':roi,
'scale':30,
'maxPixels':1e13
})
return image.set({
'water_area':img_area})
water_areas = ndwi_water.map(cal_area)
water_stats = water_areas.aggregate_array('water_area').getInfo()
water_stats
give the result as follows :
[{‘ndwi’: 35.52171285398048},
{‘ndwi’: 49.82769552462259},
{‘ndwi’: 95.52709095289183},
{‘ndwi’: 88.0812142082916},
{‘ndwi’: 93.93069886911051},
{‘ndwi’: 80.60827039904903},
{‘ndwi’: 136.78296227087307},
{‘ndwi’: 108.33794441999756},
{‘ndwi’: 171.22477916253243},
{‘ndwi’: 127.52933278774321},
{‘ndwi’: 86.3748384304267},
{‘ndwi’: 112.22821871601487},
{‘ndwi’: 101.4823960050295},
{‘ndwi’: 89.49672596974511},
{‘ndwi’: 295.2877416742835},
{‘ndwi’: 80.7449547841241},
{‘ndwi’: 120.11593294853824},
{‘ndwi’: 134.62668476349447},
{‘ndwi’: 149.84151247550966},
{‘ndwi’: 236.29430841558016},
{‘ndwi’: 158.22021181601244},
{‘ndwi’: 70.20089856972656},
{‘ndwi’: 97.93744088662496},
{‘ndwi’: 108.04200576387466},
{‘ndwi’: 107.22519927537127},
{‘ndwi’: 63.4901824073373},
{‘ndwi’: 85.06409974042677},
{‘ndwi’: 74.55227930805393},
{‘ndwi’: 221.75472506976308},
{‘ndwi’: 85.00424085790755},
{‘ndwi’: 60.99660440626263},
{‘ndwi’: 68.4423834487381},
{‘ndwi’: 67.66773335986407},
{‘ndwi’: 84.48483915371168},
{‘ndwi’: 76.99267855924732},
{‘ndwi’: 58.5695615691552},
{‘ndwi’: 87.93523549212745}]
4、 Statistical analysis
python The code is as follows :
# Time series change histogram shows
import matplotlib.pyplot as plt
x = list(range(1984, 2021))
y = [item.get('ndwi') for item in water_stats]
plt.bar(x, y, align='center', alpha=0.5)
plt.ylabel('Area hm2')
plt.title('surface water dynamics in BYH')
plt.show()

3、 ... and 、 comparative analysis
It is proposed to adopt JRC The data directly analyzes the changes of water surface , Its python The code is as follows :
【 To be analyzed ...】
give the result as follows :
Comparison and analysis of the difference between the two calculation results :
- It can be seen that ,
Four 、 Summary and discussion
- The characteristics of long-time series water surface changes in the North Canal basin are analyzed
- Problems to be explored , Water surface changes in different zones can be considered , Spatial and temporal changes of water surface in different administrative regions or upstream and downstream areas of the basin
Reference resources :
- https://geemap.org/notebooks/tn_surface_water/
- https://developers.google.com/earth-engine/apidocs/ee-image-pixelarea?hl=en
边栏推荐
- Implementation of leetcode two number addition go
- Lay the foundation for children's programming to become a basic discipline
- 创新永不止步——nVisual网络可视化平台针对Excel导入的创新历程
- paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
- 函数栈帧的创建和销毁
- Fabric.js 自由绘制矩形
- Leetcode basic programming: array
- 2022阿里巴巴全球数学竞赛 第4题 虎虎生威(盲盒问题、集卡问题)解决思路
- 農業生態領域智能機器人的應用
- el-cascader回显只选中不显示的问题
猜你喜欢

Differential identities (help find mean, variance, and other moments)
![[bus interface] Axi interface](/img/ee/95ade7811ec2c37fb67a77f0b6ae2a.jpg)
[bus interface] Axi interface

Here comes the chicken soup! Keep this quick guide for data analysts

農業生態領域智能機器人的應用

Fabric.js IText 手动设置斜体

Collectors.groupingBy 排序

Future trend of automated testing ----- self healing technology

Application d'un robot intelligent dans le domaine de l'agroécologie

解析少儿编程中的动手搭建教程

Latest: the list of universities and disciplines for the second round of "double first-class" construction was announced
随机推荐
Leetcode 18 problem [sum of four numbers] recursive solution
Black Horse Notes - - set Series Collection
Essence and physical meaning of convolution (deep and brief understanding)
国产全中文-自动化测试软件Apifox
go实现leetcode旋转数组
Fabric.js 居中元素
Mathematical knowledge -- understanding and examples of fast power
Briefly introduce chown command
Fasttext text text classification
Learn BeanShell before you dare to say you know JMeter
Global and Chinese market of travel data recorder (VDR) 2022-2028: Research Report on technology, participants, trends, market size and share
Preparation for writing SAP ui5 applications using typescript
案例分享|智慧化的西部机场
Use of typescript classes
ansible安装与使用
创新永不止步——nVisual网络可视化平台针对Excel导入的创新历程
Fabric.js 渐变
LS1046nfs挂载文件系统
National all Chinese Automatic Test Software apifox
Dark horse notes -- Set Series Collection