首页 > 其他分享 >基于夜间灯光遥感数据的中原城市群城镇空间格局研究

基于夜间灯光遥感数据的中原城市群城镇空间格局研究

时间:2022-11-02 23:23:52浏览次数:52  
标签:DN city 灯光 aie 遥感 2020 imgs 城市群 mean

基于夜间灯光遥感数据的城镇空间格局研究

基于夜间灯光提取城市建成区的范围,从而进行区域城镇化空间格局分析。

初始化环境

import aie
aie.Authenticate()
aie.Initialize()

读取行政区划数据

feature_collection = aie.FeatureCollection('user/35861bf257e14a8c807ef23cd92101c8')
geometry = feature_collection.geometry()
map = aie.Map(
    center=geometry.getCenter(),
    height=800,
    zoom=5
)

vis_params = {
    'color': '#00FF00'
}
map.addLayer(
    geometry,
    vis_params,
    'region',
    bounds=geometry.getBounds()
)
map

中原城市群

2020年中原城市群

#指定检索数据集,可设置检索的时间范围
dataset = aie.ImageCollection('NOAA_VIIRS_DNB_ANNUAL_V2_VCMSLCFG') \
             .filterDate("2020-01-01", "2020-12-31")
imgs = dataset.select(['average'])
imgs = imgs.mosaic()
imgs = imgs.clip(geometry)

# vis_params = {
#     'bands': 'average',
#     'min': 0.0,
#     'max': 60.0
# }
# map.addLayer(
#     imgs,
#     vis_params,
#     'Nighttime average',
#     bounds=imgs.getBounds()
# )
# map

DN_mean_2020 = imgs.reduceRegion(aie.Reducer.mean())
DN_mean_2020.getInfo()
DN_mean_2020 = DN_mean_2020.getInfo()['average_mean']
# 经过多次对比,将阈值设置为20,这个阈值大家可以设置的更加科学
city_2020 = imgs.gte(aie.Image.constant(20))
mask_params = {
    'bands': 'average',
    'min': 0,
    'max': 1,
    'paletee':['#000000','#ffffff']
}
map.addLayer(
    city_2020,
    mask_params,
    'city_2020',
    bounds=city_2020.getBounds()
)
map

2020年中原城市群

# task = aie.Export.image.toAsset(city_2020,'city_2020',1000)
# task.start()

2018年中原城市群

#指定检索数据集,可设置检索的时间范围
dataset = aie.ImageCollection('NOAA_VIIRS_DNB_ANNUAL_V2_VCMSLCFG') \
             .filterDate("2018-01-01", "2018-12-31")
imgs = dataset.select(['average'])
imgs = imgs.mosaic()
imgs = imgs.clip(geometry)
DN_mean_2018 = imgs.reduceRegion(aie.Reducer.mean())
DN_mean_2018.getInfo()
DN_mean_2018 = DN_mean_2018.getInfo()['average_mean']
city_2018 = imgs.gte(aie.Image.constant(20))
mask_params = {
    'bands': 'average',
    'min': 0,
    'max': 1,
    'paletee':['#000000','#ffffff']
}
map.addLayer(
    city_2018,
    mask_params,
    'city_2018',
    bounds=city_2018.getBounds()
)
map

2018年中原城市群

2016年中原城市群

#指定检索数据集,可设置检索的时间范围
dataset = aie.ImageCollection('NOAA_VIIRS_DNB_ANNUAL_V2_VCMSLCFG') \
             .filterDate("2016-01-01", "2016-12-31")
imgs = dataset.select(['average'])
imgs = imgs.mosaic()
imgs = imgs.clip(geometry)
DN_mean_2016 = imgs.reduceRegion(aie.Reducer.mean())
DN_mean_2016.getInfo()
DN_mean_2016 = DN_mean_2016.getInfo()['average_mean']
city_2016 = imgs.gte(aie.Image.constant(20))
mask_params = {
    'bands': 'average',
    'min': 0,
    'max': 1,
    'paletee':['#000000','#ffffff']
}
map.addLayer(
    city_2016,
    mask_params,
    'city_2016',
    bounds=city_2016.getBounds()
)
map

2016年中原城市群

2014年中原城市群

#指定检索数据集,可设置检索的时间范围
dataset = aie.ImageCollection('NOAA_VIIRS_DNB_ANNUAL_V2_VCMSLCFG') \
             .filterDate("2014-01-01", "2014-12-31")
imgs = dataset.select(['average'])
imgs = imgs.mosaic()
imgs = imgs.clip(geometry)

DN_mean_2014 = imgs.reduceRegion(aie.Reducer.mean())
DN_mean_2014.getInfo()
DN_mean_2014 = DN_mean_2014.getInfo()['average_mean']
city_2014 = imgs.gte(aie.Image.constant(20))
mask_params = {
    'bands': 'average',
    'min': 0,
    'max': 1,
    'paletee':['#000000','#ffffff']
}
map.addLayer(
    city_2014,
    mask_params,
    'city_2014',
    bounds=city_2014.getBounds()
)
map

2014年中原城市群

平均灯光亮度变化

import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
x = np.array([2014,2016,2018,2020])
Y = np.array([DN_mean_2014,DN_mean_2016,DN_mean_2018,DN_mean_2020])
plt.figure(figsize=(10,8))
ax = plt.gca()
ax.plot(x,Y,'o-')
ax.set_yticks([0,0.5,1,1.5])
ax.set_xticks([2014,2016,2018,2020])
for a,b in zip(x,Y):
    plt.text(a,b+0.02,'%.4f'%b,ha='center',va='bottom',fontsize=9)

image.png

建成区面积变化

比如还可以做建成区面积的变化对比,这方面还不太支持,所以知识给大家一个思路,还比如 CNLI 的区域整体城镇化水平动态演化。还有就是阈值的确定还不够合理,大家应该有更加合理确定阈值的方法,本次案例主要引用了《城市与区域规划空间分析实验教程》(第3版)中的实验13。

标签:DN,city,灯光,aie,遥感,2020,imgs,城市群,mean
From: https://www.cnblogs.com/truggling-zx/p/16852931.html

相关文章

  • 记录一下实现进度条的方法!(遥感程序设计)
     首先不得不先说到我们最爱的backgroundworker!虽然在抠破头皮也没想出来怎么把程序实际进度返回到进度条,但是在老师的指点下目前还是顺利的换了方法(bushi1、静态处理......
  • [单片机框架] [app_led] 利用软定时器实现闪烁和呼吸等灯光模式
    使用例子:任意地点初始化:app_led_init();app_led_indicate(灯号,灯光类型,周期时间,重装载值);注:需要先实现对应PWM函数文件代码如下app_led.c/***************************......
  • ANT+ 自行车车灯 数据页面6–辅助灯光模式支持(0x06)
    ANT+控制器可以请求此页面(如5.3节中所述),以确定每个子灯支持哪些自定义模式。当ANT+控制器请求时,数据页6从ANT+自行车灯广播。任何带有副灯的ANT+自行车灯均应支持此页面。该......
  • 遥感影像基本概念
    1、基本概念广义:泛指一切无接触的远距离探测,包括对电磁场、力场、机械波(声波、地震波)等的探测。【利用仪器设备从远处获得被测物体的电磁波辐射特征(光,热),力场特征(......
  • 多光谱遥感分类(二):VGG微调
    继上篇。CNN模型使用VGG16预训练模型。fromkeras.preprocessing.imageimportImageDataGeneratorfromkeras.callbacksimportTensorBoardfromkeras.applicationsimpor......
  • 多光谱遥感分类(四):使用GLCM+RF
    所用数据:​​多光谱遥感分类:使用CNN1(一)​​提取纹理特征。importnumpyasnpimportcv2importosfromskimage.featureimportgreycomatrix,greycopropsimportpandasas......
  • 遥感期末复习
    title:遥感期末复习excerpt:考完试就删~tags:[遥感,期末]categories:[life,杂谈]index_img:https://picture-store-repository.oss-cn-hangzhou.aliyuncs.com......
  • After Effects 教程,如何在 After Effects 中将灯光添加到 3D 场景?
    欢迎观看AfterEffects教程,小编带大家学习aftereffects视频特效软件的基本工具和使用技巧,了解如何在AE中将灯光添加到3D场景。将灯光添加到场景以创建更多透视,灯光......