C33 城市环境(Part 7)
导读
- 在过去的几十年里,城市化及其影响迅速扩大。1950年,世界上只有30%的人口居住在城市地区,但到2050年,这一数字预计将达到68%(联合国2019年)。世界上已有超过50%的人口生活在城市地区(联合国,2019年)。这种向城市居住的转变帮助数百万人摆脱了贫困,但也带来了复杂的社会环境挑战,如栖息地丧失、城市热岛、洪水和更多的温室气体排放。
- 应对这些挑战的一个重要部分是了解城市化轨迹及其影响。卫星图像为全球城市化提供了丰富的历史和当前信息来源,并越来越多地用于城市可持续性研究(Goldblatt等人2018;Prakash et al 2020)。
- 我们将介绍几种可视化和量化城市化对景观影响的方法。
主要内容:
- 创建动画GIF;
- 基于已有的城市分类结果实现数量和质量分析;
- 运行你自己的LUCC分类;
- 城镇化时空变化制图。
Section1 时间序列动画GIF
qualitative depiction of the impact of urbanization 城市化影响的定性描述
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | / / Filter collection. var collection = ee.ImageCollection( 'LANDSAT/LC08/C02/T1_L2' ) .filterBounds(geometry) .filterDate( '2013-01-01' , '2023-12-31' ) . filter (ee. Filter .lte( 'CLOUD_COVER_LAND' , 3 )); / / Define GIF visualization arguments. var gifParams = { bands: [ 'SR_B4' , 'SR_B3' , 'SR_B2' ], min : 0.07 * 65536 , max : 0.3 * 65536 , region: geometry, framesPerSecond: 4 , format : 'gif' }; / / Render the GIF animation in the console. print (ui.Thumbnail(collection, gifParams)); |
大兴机场GIF
Section2 现有城市分类产品
有几种可公开访问的土地覆盖分类,其中就包括城市地区。这些分类是确定城市范围的一种快速方法。
GEE上的3种公开的城市分类数据产品:
1)the MODIS LandCover Type Yearly Global;
覆盖范围:全球
2)the Copernicus CORINE Land Cover;
覆盖范围:欧盟
3)the United States Geological Survey (USGS) National Land Cover Database (NLCD).
覆盖范围:美国
2.1 MCD12Q1.061 MODIS Land Cover Type Yearly Global 500m 数据介绍
LC_Type1-5 代表不同的分类体系
LC_Type1 分类体系
1. 常绿针叶林:以常绿针叶林为主(冠层>2米)。林木覆盖率>60%。
2.常绿阔叶林:以常绿阔叶林和棕榈树为主,树冠>2m。林木覆盖率>60%。
3.落叶针叶林:以落叶针叶林(落叶松)为主(树冠>2米)。林木覆盖率>60%。
4.落叶阔叶林:以落叶阔叶树(冠层>2米)为主。林木覆盖率>60%。
5.混交林:以落叶和常绿两种树种(各占40-60%)为主,树冠大于2米。林木覆盖率>60%。
6.封闭灌丛:以多年生木本植物(1-2m高)为主,盖度>60%。
7.开阔灌丛:以多年生木本植物(1-2米高)为主,覆盖度为10-60%。
8.木质稀疏草原:树木覆盖率30-60%(树冠>2米)。
9.稀疏草原:树木覆盖率10-30%(树冠>2米)。
10.草地:以草本一年生植物为主(<2m)。
11.永久湿地:永久被淹没的土地,水覆盖率为30-60%,植被覆盖率>10%。
12.农田:至少60%的面积为耕地。
13.城市和建设用地:至少30%的不透水表面面积,包括建筑材料、沥青和车辆。
14.农田/天然植被
15.永久冰雪:一年中至少有10个月至少60%的面积被冰雪覆盖。
16.裸地:至少60%的面积为植被不足10%的无植被贫瘠(沙、岩、土)地区。
17.水体:至少60%的面积被永久性水体覆盖。
示例:看一下海口的Modis 城市产品
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | / / MODIS (haikou) / / Center over 海口. Map .setCenter( 110.31955 , 20.010 , 11 ); / / Visualize the full classification. var MODIS_lc = ee.ImageCollection( "MODIS/061/MCD12Q1" ).select( 'LC_Type1' ); var igbpLandCoverVis = { min : 1.0 , max : 17.0 , palette: [ '05450a' , '086a10' , '54a708' , '78d203' , '009900' , 'c6b044' , 'dcd159' , 'dade48' , 'fbff13' , 'b6ff05' , '27ff87' , 'c24f44' , 'a5a5a5' , 'ff6d4c' , '69fff8' , 'f9ffa4' , '1c0dff' ], }; Map .addLayer(MODIS_lc, igbpLandCoverVis, 'IGBP Land Cover' ); / / Visualize the urban extent in 2001 and 2019. / / 2019 var MODIS_2019 = MODIS_lc.filterDate(ee.Date( '2019-01-01' )); / / 查看元数据可以看到,urban类的值为 13 var M_urb_2019 = MODIS_2019.mosaic().eq( 13 ); Map .addLayer(M_urb_2019.mask(M_urb_2019), { 'palette' : 'FF0000' }, 'MODIS Urban 2019' ); / / 2001 var MODIS_2001 = MODIS_lc.filterDate(ee.Date( '2001-01-01' )); var M_urb_2001 = MODIS_2001.mosaic().eq( 13 ); Map .addLayer(M_urb_2001.mask(M_urb_2001), { 'palette' : 'a5a5a5' }, 'MODIS Urban 2001' ); |
2001
2019
Section 3. 城区分类
前面,我们依靠几种LULC分类产品来估计建成区土地覆盖的分布及其随时间的变化。
下面我们基于影像,采用随机森林方法,进行城镇LUCC分类。
基于Landsat 7卫星数据:
我们用1-6波段进行实验
使用GEE上自带的去云函数:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | / / Surface reflectance function from example: function maskL457sr(image) { var qaMask = image.select( 'QA_PIXEL' ).bitwiseAnd(parseInt( '11111' , 2 )).eq( 0 ); var saturationMask = image.select( 'QA_RADSAT' ).eq( 0 ); / / Apply the scaling factors to the appropriate bands. var opticalBands = image.select( 'SR_B.' ).multiply( 0.0000275 ).add( - 0.2 ); var thermalBand = image.select( 'ST_B6' ).multiply( 0.00341802 ).add( 149.0 ); / / Replace the original bands with the scaled ones and apply the masks. return image.addBands(opticalBands, null, true) .addBands(thermalBand, null, true) .updateMask(qaMask) .updateMask(saturationMask); } / / Map the function over one year of data. var collection = ee.ImageCollection( "LANDSAT/LE07/C02/T1_L2" ) .filterDate( '2020-01-01' , '2021-01-01' ) . map ( maskL457sr); var landsat7_2020 = collection.median(); Map .addLayer(landsat7_2020, { bands: [ 'SR_B3' , 'SR_B2' , 'SR_B1' ], min : 0 , max : 0.3 }, 'landsat 7, 2020' ); var lc = nbu.merge(bu); print ( "样本lc" ,lc); var bands = [ 'SR_B1' , 'SR_B2' , 'SR_B3' , 'SR_B4' , 'SR_B5' , 'ST_B6' , 'SR_B7' ]; var training = landsat7_2020.select(bands).sampleRegions({ collection: lc, properties: [ 'class' ], scale: 30 }); / / Create a random forest classifier with 20 trees. var classifier = ee.Classifier.smileRandomForest({ numberOfTrees: 20 }).train({ / / Train the classifier. / / Use the examples we got when we sampled the pixels. features: training, / / This is the class that we want to predict. classProperty: 'class' , / / The bands the classifier will use for training and classification. inputProperties: bands }); / / Apply the classifier on the 2020 image. var classified20 = landsat7_2020.select(bands).classify(classifier); Map .addLayer(classified20.mask(classified20), { palette: [ '#ff4218' ], opacity: 0.6 }, 'built-up, 2020' ); var landsat7_2010 = ee.ImageCollection( "LANDSAT/LE07/C02/T1_L2" ) .filterDate( '2010-01-01' , '2010-12-31' ) . map (maskL457sr).median(); / / Apply the classifier to the 2010 image. var classified10 = landsat7_2010.select(bands).classify( classifier); Map .addLayer(classified10.mask(classified10), { palette: [ '#f1ff21' ], opacity: 0.6 }, 'built-up, 2010' ); var difference = classified20.subtract(classified10); Map .addLayer(difference.mask(difference), { palette: [ '#315dff' ], opacity: 0.6 }, 'difference' ); |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了