当前位置:网站首页>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
边栏推荐
- 函数栈帧的创建和销毁
- LeetCode 1175. Prime number arrangement (prime number judgment + Combinatorial Mathematics)
- About PROFIBUS: communication backbone network of production plant
- 培养中小学生对教育机器人的热爱之心
- Map in JS (including leetcode examples)
- 【pyinstaller】_get_sysconfigdata_name() missing 1 required positional argument: ‘check_exists‘
- Dark horse notes -- map set system
- How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
- Collectors. Groupingby sort
- Video cover image setting, put cover images into multiple videos in the simplest way
猜你喜欢
Save the CDA from the disc to the computer
[Yu Yue education] autumn 2021 reference materials of Tongji University
[bus interface] Axi interface
4. Flask cooperates with a tag to link internal routes
Analyzing the hands-on building tutorial in children's programming
将光盘中的cda保存到电脑中
Fabric.js 激活输入框
Simple and practical accounting software, so that accounts can be checked
Lay the foundation for children's programming to become a basic discipline
Getting started with pytest ----- confitest Application of PY
随机推荐
Using Kube bench and Kube hunter to evaluate the risk of kubernetes cluster
leetcode两数相加go实现
Application of intelligent robot in agricultural ecology
Rhcsa --- work on the third day
Acelems Expressway microgrid energy efficiency management platform and intelligent lighting solution intelligent lighting tunnel
[high speed bus] Introduction to jesd204b
画波形图_数字IC
运维工作的“本手、妙手、俗手”
Use of Baidu map
Video multiple effects production, fade in effect and border background are added at the same time
10 minute quick start UI automation ----- puppeter
Lay the foundation for children's programming to become a basic discipline
Go implements leetcode rotation array
7.1 Résumé du concours de simulation
6.30年终小结,学生时代结束
Lm09 Fisher inverse transform inversion mesh strategy
Record my pytorch installation process and errors
How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
js中的Map(含leetcode例题)
Global and Chinese market of cell culture freezers 2022-2028: Research Report on technology, participants, trends, market size and share