当前位置:网站首页>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
边栏推荐
- Feign realizes file uploading and downloading
- Lm09 Fisher inverse transform inversion mesh strategy
- Practical problem solving ability of steam Education
- Go implements leetcode rotation array
- Basic differences between Oracle and MySQL (entry level)
- How to configure PostgreSQL 12.9 to allow remote connections
- About PROFIBUS: communication backbone network of production plant
- LeetCode 1175. 质数排列(质数判断+组合数学)
- Dark horse notes -- map set system
- 6.30年终小结,学生时代结束
猜你喜欢

Collectors.groupingBy 排序

Paddlepaddle project source code

Fabric.js 右键菜单

黑马笔记---Set系列集合

创新永不止步——nVisual网络可视化平台针对Excel导入的创新历程

Knowledge arrangement about steam Education

Video multiple effects production, fade in effect and border background are added at the same time

LS1046nfs挂载文件系统

4. Flask cooperates with a tag to link internal routes

Collectors. Groupingby sort
随机推荐
Feign realizes file uploading and downloading
[common error] the DDR type of FPGA device is selected incorrectly
Fabric.js 自由绘制矩形
How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
Application of intelligent robot in agricultural ecology
LeetCode 241. Design priorities for operational expressions (divide and conquer / mnemonic recursion / dynamic programming)
C # picture display occupancy problem
摆正元素(带过渡动画)
Application d'un robot intelligent dans le domaine de l'agroécologie
How to make an RPM file
js面试收藏试题1
创新永不止步——nVisual网络可视化平台针对Excel导入的创新历程
el-cascader回显只选中不显示的问题
Mysql重点难题(2)汇总
Pyechats 1.19 generate a web version of Baidu map
Global and Chinese market of cell culture freezers 2022-2028: Research Report on technology, participants, trends, market size and share
Pyflink writes MySQL examples with JDBC
Collectors.groupingBy 排序
JS interview collection test question 1
Lm09 Fisher inverse transform inversion mesh strategy