Google earth engine(GEE)——不同区域温度散点折线图绘制

简介: Google earth engine(GEE)——不同区域温度散点折线图绘制


 

最后显示的效果就是上图,城市,森林和荒漠的不同时候的温度

折起没有什么难度,所以直接上代码:


总而言之,就是先把影像和区域弄好,然后设置自己的要遍历的内容,最后成图,成图的部分分为三点,第一个是设置影像中最合性的内容,也就是你要选择ui.Chart.image.后面的内容,然后设置你选择要出图的类型,最后设置图上的一些标题大小等等。


ui.Chart.image

ui.Chart.image.byClass(image, classBand, region, reducer, scale, classLabels, xLabels)

ui.Chart.image.byRegion(image, regions, reducer, scale, xProperty)

ui.Chart.image.doySeries(imageCollection, region, regionReducer, scale, yearReducer, startDay, endDay)

ui.Chart.image.doySeriesByRegion(imageCollection, bandName, regions, regionReducer, scale, yearReducer, seriesProperty, startDay, endDay)

ui.Chart.image.doySeriesByYear(imageCollection, bandName, region, regionReducer, scale, sameDayReducer, startDay, endDay)

ui.Chart.image.histogram(image, region, scale, maxBuckets, minBucketWidth, maxRaw, maxPixels)

ui.Chart.image.regions(image, regions, reducer, scale, seriesProperty, xLabels)

ui.Chart.image.series(imageCollection, region, reducer, scale, xProperty)

ui.Chart.image.seriesByRegion(imageCollection, regions, reducer, band, scale, xProperty, seriesProperty)

// 先分别设置不同区域的颜色
var COLOR = {
  CITY: 'ff0000',
  DESERT: '0000ff',
  FOREST: '00ff00'
};
//之前我们觉得例子是点,这次我们选择面,同样是三个句型选择区域,分别给标签命名,最后作为你散点图上的图例
var city = ee.Feature(    // San Francisco.
    ee.Geometry.Rectangle(-122.45, 37.74, -122.4, 37.8),
    {label: 'City'});
var forest = ee.Feature(  // Tahoe National Forest.
    ee.Geometry.Rectangle(-121, 39.4, -120.8, 39.8),
    {label: 'Forest'});
var desert = ee.Feature(  // Black Rock Desert.
    ee.Geometry.Rectangle(-119.15, 40.8, -119, 41),
    {label: 'Desert'});
//将多个句型放在一个矢量集合当中,注意,这里是以名字放入一个列表当中
var westernRegions = new ee.FeatureCollection([city, forest, desert]);
// Get brightness temperature data for 1 year.
var landsat8Toa = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA');
var temps2013 = landsat8Toa.filterBounds(westernRegions)
    .filterDate('2015-12-25', '2016-12-25')
    .select('B10');
//B10 Thermal infrared 1, resampled from 100m to 30m  30 meters 10.60 - 11.19 µm
// 从B10波段的热红外波段值转化为温度值
temps2013 = temps2013.map(function(image) {
  return image.addBands(image.subtract(273.15).select([0], ['Temp']));
//返回值是一个运算玩的温度值,并且添加波段在第一个,并且命名为Temp
});
// 这个就是设置时间序列的影像了,区域加载进来,平求出平均值
var tempTimeSeries = ui.Chart.image.seriesByRegion({
  imageCollection: temps2013,
  regions: westernRegions,
  reducer: ee.Reducer.mean(),
  band: 'Temp',
  scale: 200,
  xProperty: 'system:time_start',
  seriesProperty: 'label'
});
//设置图标的类型
tempTimeSeries.setChartType('ScatterChart');
//设置图标类型的参数
tempTimeSeries.setOptions({
  title: 'Temperature over time in regions of the American West',
  vAxis: {
    title: 'Temperature (Celsius)'
  },
  lineWidth: 1,
  pointSize: 4,
  series: {
    0: {color: COLOR.CITY},
    1: {color: COLOR.FOREST},
    2: {color: COLOR.DESERT}
  }
});
//最后答应出来
print(tempTimeSeries);
Map.addLayer(desert, {color: COLOR.DESERT});
Map.addLayer(forest, {color: COLOR.FOREST});
Map.addLayer(city, {color: COLOR.CITY});
Map.setCenter(-121, 39.4, 6);

 


相关文章
|
4月前
|
数据可视化 定位技术 Sentinel
如何用Google Earth Engine快速、大量下载遥感影像数据?
【2月更文挑战第9天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,批量下载指定时间范围、空间范围的遥感影像数据(包括Landsat、Sentinel等)的方法~
1942 1
如何用Google Earth Engine快速、大量下载遥感影像数据?
|
4月前
|
机器学习/深度学习 算法 数据可视化
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
基于Google Earth Engine云平台构建的多源遥感数据森林地上生物量AGB估算模型含生物量模型应用APP
193 0
|
4月前
GEE——Google dynamic world中在影像导出过程中无法完全导出较大面积影像的解决方案(投影的转换)EPSG:32630和EPSG:4326的区别
GEE——Google dynamic world中在影像导出过程中无法完全导出较大面积影像的解决方案(投影的转换)EPSG:32630和EPSG:4326的区别
92 0
|
4月前
|
存储 编解码 数据可视化
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
【2月更文挑战第14天】本文介绍在谷歌地球引擎(Google Earth Engine,GEE)中,按照给定的地表分类数据,对每一种不同的地物类型,分别加以全球范围内随机抽样点自动批量选取的方法~
424 1
Google Earth Engine获取随机抽样点并均匀分布在栅格的不同数值区中
|
4月前
|
API Go 网络架构
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
241 4
|
4月前
|
机器学习/深度学习 存储 人工智能
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
GEE Colab——初学者福音快速入门 Google Colab(Colaboratory)
202 3
|
4月前
|
编解码 人工智能 算法
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
Google Earth Engine——促进森林温室气体报告的全球时间序列数据集
71 0
|
4月前
|
编解码 人工智能 数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
Google Earth Engine(GEE)——全球道路盘查项目全球道路数据库
100 0
|
4月前
|
编解码
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
Open Google Earth Engine(OEEL)——matrixUnit(...)中产生常量影像
59 0
|
4月前
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
Google Earth Engine(GEE)——导出指定区域的河流和流域范围
174 0

热门文章

最新文章