赞
踩
Google 地球引擎 (GEE) 消除了传统上使用遥感数据所涉及的下载、预处理和繁重的计算环境。虽然针对“大数据”进行了优化,但
GEE 是一个灵活且透明的平台,可以处理从林业到干旱监测再到作物制图的各种研究领域。
注意:问号图标会进行更详细的导航
1)搜索栏:搜索数据集、搜索地点等
2)左面板:
脚本:
文档:可用函数列表,具体的函数有定义和要求,如果您只能记住部分函数名称,则可以通过按 ctrl-space(Mac 上为cmd-space)调出建议列表来避免查找它 资产:您上传到 GEE的所有文件都将在此选项卡中列出。单击文件名会显示有关文件的一些基本信息,并为您提供导入、共享或删除的选项
3)
脚本编辑器:编写代码,javascript语言,没有自动保存功能
4)Right Panel:
Inspector
打开此选项卡会更改我们与 Map Viewer 的交互。鼠标光标变为十字准线,单击地图可让我们从特定纬度和经度中采样数据。
在“检查器”选项卡处于活动状态的情况下,单击地图可为我们提供纬度和经度坐标配对。
控制台
这是 GEE 加载时的默认选项卡,包含与在脚本编辑器中访问的数据相关的有用信息以及统计打印输出和错误消息。
任务
在此选项卡中,我们可以跟踪导出/下载队列中任何数据的进度。模块 4将介绍更多关于将数据移出 GEE 的内容。
5)地图查看器
绘制形状和切换可见或隐藏图层。
这意味着我们可以访问集合中的所有数据,可以使用各种方法进行筛选:
使用该filterDate() 功能修改我们的原始收藏并限制图像数量。
// Call in NAIP imagery as an image collection.
var NAIP = ee.ImageCollection("USDA/NAIP/DOQQ");
// Filter your dataset from the entire collection to the year of interest and extent.
var naip2011 = NAIP
.filterDate("2011-01-01", "2011-12-31");
例如查看波段
步骤:搜索——关键词
复制相应数据集的名称,在代码中加入import,
// Define visualization parameters.
var visParamsFalse = {bands:['N', 'R', 'G']};
var visParamsTrue = {bands:['R', 'G', 'B']};
// Add 2011 imagery to the map with false color and true color composites
// here we specify either 'true; or 'false' in the third argument to toggle the layer to show automatically or to stay hidden when the code is exicuted.
Map.addLayer(naip2011,visParamsFalse, "2011_false", true );
Map.addLayer(naip2011,visParamsTrue, "2011_true", false );
点、线和多边形通常被归类为“矢量”对象,在 GEE 中,这些数据被称为几何。可以上传或创建希望在 GEE 中使用的几何特征。可以使用如下方式创建感兴趣区域 (AOI)
1)画感兴趣区域,感兴趣点
filterBounds()可以定位
var naip2011 = NAIP
.filterDate("2011-01-01", "2011-10-31")
.filterBounds(bounds);
2)经纬度坐标
filterBounds()为了避免每次加载脚本时都必须放大
centerObject()功能以预定义的缩放级别
Map.centerObject(naip2011, 11);
// Call in NAIP imagery as an image collection. var NAIP = ee.ImageCollection("USDA/NAIP/DOQQ"); // Enter the desired coordinates for the upper left and lower right corners of your study area. var bounds = ee.Geometry.Rectangle([[-105.53,40.75],[-105.17,40.56]]); // Filter your dataset from the entire collection to the year of interest and extent. var naip2011 = NAIP .filterDate("2011-01-01", "2011-12-31") .filterBounds(bounds); // Define visualization parameters. var visParamsFalse = {bands:['N', 'R', 'G']}; var visParamsTrue = {bands:['R', 'G', 'B']}; // Add 2011 imagery to the map with false color and true color composites. Map.addLayer(naip2011,visParamsFalse,"2011_false", false ); Map.addLayer(naip2011,visParamsTrue,"2011_true", false ); Map.centerObject(naip2011, 11); // Add 2013 imagery to the map with false color and true color composites. var naip2013 = NAIP .filterDate("2013-01-01", "2013-12-31") .filterBounds(bounds); // Add 2013 imagery to the map with false color and true color composites. Map.addLayer(naip2013,visParamsFalse,"2013_false", false ); Map.addLayer(naip2013,visParamsTrue,"2013_true", false );
Google 地球引擎数据目录
1、数据类别:影像
图像栅格通常被分成许多子图像(波段),这些子图像(波段)对应于特定的光波长范围
2、数据类别:地形,DEM(例如NED等),土地覆盖等
MODIS 数据集的空间分辨率,以米为单位。这是一个相对较低的分辨率,更适合区域或全球分析
例子二:
图像采集
// Load the image collection. var dataset = ee.ImageCollection('MODIS/006/MYD10A1'); // Limit the collection date range to 2018. var dataset = dataset .filterDate('2018-01-01', '2018-12-31'); // Select the snow cover layer and compute the mean. var snowCover = dataset .select('NDSI_Snow_Cover') .mean(); // Define the visualization parameters and add the collection to the map. var snowCoverVis = {min: 0.0, max: 100.0, palette: ['black', '0dffff', '0524ff', 'ffffff']}; Map.addLayer(snowCover, snowCoverVis, 'Snow Cover'); var dataset = dataset .filterBounds(ee.Geometry.Point(27.5487, 41.2568)); // Use your own coordinates here! // Print the number of images in the collection print('Count: ', dataset.size()); // Print the whole date range of the filtered collection. var range = dataset.reduceColumns(ee.Reducer.minMax(), ["system:time_start"]) print('Date range: ', ee.Date(range.get('min')), ee.Date(range.get('max')));
// Load the Landsat image collection.
var ls8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR");
// Filter the collection by date and cloud cover.
var ls8 = ls8
.filterDate('2017-05-01','2017-09-30')
.filterMetadata('CLOUD_COVER','less_than', 3.0);
// There are a number of keys that you can use in a visParams dictionary.
// Here, we are going to start by defining our 'bands', 'min', 'max', and 'gamma' values.
// You can think of 'gamma' essentially as a brightness level.
var ls_tci = {bands: ['B4','B3','B2'], min: 0, max: 3000, gamma: 1.4};
Map.setCenter(-73.755, 45.5453, 11);
Map.addLayer(ls8, ls_tci, 'True Color');
可以区分土地覆盖类别(即森林覆盖与农田)以及类别内的条件,例如区域较深红色的更活跃的植被,用彩色红外图像替换我们的真彩色图像,以识别加拿大蒙特利尔和周边陆地区域的活跃植被和水道区域。
// Add the Color Infrared visualization.
var ls_ci = {bands: ['B5','B4','B3'], min: 0, max: 3000, gamma: [0.7, 1, 1]};
Map.addLayer(ls8, ls_ci, 'Color Infrared');
将两个额外的假彩色合成 (FC1) 与我们的其他多波段图像进行比较。在水体中,对短波和长波红外波长的吸收率很高。因此,这些图像中的水体会显得很暗,而真彩色图像中一些茂密的植被也会显得很暗。FC1 中的波段组合还应突出灰色/紫色的密集城市发展区域,而休耕农田将显示为浅棕色。
// Add the False Color 1 visualization.
var ls_fc1 = {bands: ['B6','B5','B4'], min: 0, max: 4000, gamma: 0.9};
Map.addLayer(ls8, ls_fc1, 'False Color 1');
// Add the False Color 2 visualization.
var ls_fc2 = {bands: ['B7','B6','B4'], min: 0, max: 3000, gamma: 0.9};
Map.addLayer(ls8, ls_fc2, 'False Color 2');
不同的地图可视化技术:调色板。调色板是我们可以在 Google 地球引擎中传达连续或分类数据的方式,但在使用调色板时了解我们的最小值和最大值很重要。请记住,我们可以通过单击“检查器”选项卡来采样值。
为了了解如何有效地使用调色板来解释连续数据,我们将使用来自 Landsat 的 Gross Primary Productivity 栅格。初级生产力总值在此定义为“生态系统中植物捕获的碳量”的量度。使用以下代码启动一个新脚本,以可视化美国华盛顿州喀斯喀特山脉东坡的数据。对我们来说方便的是,数据集已经过滤掉了水体和大气效应。运行脚本,您应该会看到如下图所示的图像。
通过使用这个特定的调色板,我们可以开始挑选土地管理活动。强烈的几何和/或线性特征可以指示森林采伐和农业等活动,而不规则形状通常可以是保护区(即国家森林或荒野地区)。
// Load and select the Gross Primary Production (GPP) image collection.
var dataset = ee.ImageCollection('UMT/NTSG/v2/LANDSAT/GPP')
.filter(ee.Filter.date('2018-05-01', '2018-10-31'));
var gpp = dataset.select('GPP');
// Build a set of visualization parameters and add the GPP layer to the map.
var gppVis = {
min: 0.0,
max: 500.0,
palette: ['ffffe5','f7fcb9','d9f0a3','addd8e','78c679','41ab5d','238443','005a32']};
Map.setCenter(-120.9893, 47.2208, 10);
Map.addLayer(gpp, gppVis, 'GPP');
用调色板来突出显示分类数据。如果我们想在研究区域创建森林/非森林掩膜,我们可以使用国家土地覆盖数据集NLCD以深绿色突出显示所有森林类别。NLCD 中有许多土地覆盖类别,但为了简化此示例,我们仅在东部瀑布的同一区域使用“落叶林”、“常绿林”和“混交林”。再次启动一个新脚本并粘贴下面的代码。您应该会看到类似于下图的结果图像。
// Load the NLCD image collection and select the land cover layer.
var dataset = ee.ImageCollection('USGS/NLCD');
var landcover = dataset.select('landcover');
// Values from 41-43 represent explicitly defined forest types.
var landcoverVis = {
min: 41.0,
max: 43.0,
palette: ['black','green', 'green','green','black'],
opacity: 0.75
};
Map.setCenter(-120.9893, 47.2208, 10);
Map.addLayer(landcover, landcoverVis, 'Landcover');
实例三
// This is a dictionary object. It has a key and an item. var dictionary_one = {key: 'item', term: 'value'} var dictionary_two = {first_key: 1.1, second_key: 2.2, third_key: 3.3} print(dictionary_one,"dict1"); print(dictionary_two, "dict2"); // Occasionally, dictionary items can be lists. Lists are simply containers for multiple items. var dictionary_with_list = {key: ['item1', 'item2', 'item3']}; print(dictionary_with_list, "dictList"); // Load the Landsat image collection. var ls8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR"); // Filter the collection by date and cloud cover. var ls8 = ls8 .filterDate('2017-05-01','2017-09-30') .filterMetadata('CLOUD_COVER','less_than', 3.0); // There are a number of keys that you can use in a visParams dictionary. // Here, we are going to start by defining our 'bands', 'min', 'max', and 'gamma' values. // You can think of 'gamma' essentially as a brightness level. var ls_tci = {bands: ['B4','B3','B2'], min: 0, max: 3000, gamma: 1.4}; Map.setCenter(-73.755, 45.5453, 11); Map.addLayer(ls8, ls_tci, 'True Color'); // Add the Color Infrared visualization. var ls_ci = {bands: ['B5','B4','B3'], min: 0, max: 3000, gamma: [0.7, 1, 1]}; Map.addLayer(ls8, ls_ci, 'Color Infrared'); // Add the False Color 1 visualization. var ls_fc1 = {bands: ['B6','B5','B4'], min: 0, max: 4000, gamma: 0.9}; Map.addLayer(ls8, ls_fc1, 'False Color 1'); // Add the False Color 2 visualization. var ls_fc2 = {bands: ['B7','B6','B4'], min: 0, max: 3000, gamma: 0.9}; Map.addLayer(ls8, ls_fc2, 'False Color 2'); // Load and select the Gross Primary Production (GPP) image collection. var dataset = ee.ImageCollection('UMT/NTSG/v2/LANDSAT/GPP') .filter(ee.Filter.date('2018-05-01', '2018-10-31')); var gpp = dataset.select('GPP'); // Build a set of visualization parameters and add the GPP layer to the map. var gppVis = { min: 0.0, max: 500.0, palette: ['ffffe5','f7fcb9','d9f0a3','addd8e','78c679','41ab5d','238443','005a32']}; Map.setCenter(-120.9893, 47.2208, 10); Map.addLayer(gpp, gppVis, 'GPP'); // Load the NLCD image collection and select the land cover layer. var dataset = ee.ImageCollection('USGS/NLCD'); var landcover = dataset.select('landcover'); // Values from 41-43 represent explicitly defined forest types. var landcoverVis = { min: 41.0, max: 43.0, palette: ['black','green', 'green','green','black'], opacity: 0.75 }; Map.setCenter(-120.9893, 47.2208, 10); Map.addLayer(landcover, landcoverVis, 'Landcover');
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。