如何在google earth engine上筛选样本点
时间: 2024-01-11 22:00:40 浏览: 108
在Google Earth Engine上筛选样本点可以按照以下步骤进行:
1. 打开Google Earth Engine的网页,登录您的账户。
2. 在左上方的搜索栏中输入您感兴趣的地理位置,然后按下回车键。
3. 在地图上找到您感兴趣的区域,并使用放大和缩小按钮调整地图的比例尺。
4. 在左上方的工具栏中,选择“绘图工具”图标,然后选择“点”工具。
5. 在地图上单击您想要添加样本点的位置,您可以添加多个点。
6. 在右侧的“图层面板”中,找到并选择刚刚添加的点图层。
7. 单击“导出”按钮,选择您想要导出的样本点的格式,如CSV文件。
8. 还可以设置一些导出选项,如文件名称、文件夹、导出区域等,然后单击“开始导出”按钮。
9. 导出完成后,您可以从导出设置中选择“下载”按钮,将样本点文件保存到您的计算机上。
通过上述步骤,您可以在Google Earth Engine上筛选并导出您所需要的样本点。您可以重复这个过程,以添加更多的样本点或在其他区域进行筛选。
相关问题
在Google earth engine中为什么合并样本点无法运行?
对于您的问题,我可以尝试提供一些帮助。可能是由于样本点中存在重复的要素,导致合并失败。您可以尝试在合并样本点之前,使用去重工具删除重复要素,然后再尝试运行合并操作。另外,您也可以在 Google Earth Engine 开发者社区中咨询其他开发者,以寻求更多帮助。
在Google Earth Engine(GEE)上获取逐日NDVI的代码
以下是使用Google Earth Engine获取逐日NDVI的代码示例:
```javascript
// 设置ROI
var roi = ee.Geometry.Rectangle([xmin, ymin, xmax, ymax]);
// 设置起始和结束日期
var startDate = ee.Date('2019-01-01');
var endDate = ee.Date('2019-12-31');
// 加载MODIS数据
var modis = ee.ImageCollection('MODIS/006/MOD13A1')
.filterBounds(roi)
.filterDate(startDate, endDate)
.select('NDVI');
// 定义函数计算每个图像的年份和日数
var addDate = function(image) {
var doy = image.date().getRelative('day', 'year');
return image.addBands(doy).addBands(image.date().get('year'));
};
// 对图像集应用函数
var modisWithDate = modis.map(addDate);
// 定义函数计算每个年份和日数的平均NDVI值
var reduceDaily = function(imageCollection, year, doy) {
var filtered = imageCollection.filter(ee.Filter.calendarRange(year, year, 'year'))
.filter(ee.Filter.calendarRange(doy, doy, 'day_of_year'));
return filtered.mean().set('year', year).set('doy', doy);
};
// 创建一个二维数组,其中第一维表示年份,第二维表示一年中的日数
var years = ee.List.sequence(startDate.get('year'), endDate.get('year'));
var days = ee.List.sequence(1, 365);
// 对所有年份和日数应用reduceDaily函数
var dailyNDVI = ee.ImageCollection.fromImages(years.map(function(y){
return days.map(function(d){
return reduceDaily(modisWithDate, y, d);
});
}).flatten());
// 打印输出结果
print(dailyNDVI);
```
在上述代码中,首先定义了一个感兴趣区域(ROI),然后加载了2000年至今的MODIS NDVI数据,并对其进行了筛选。接着定义了两个函数,一个函数用于向每个图像添加年份和日数作为带宽,另一个函数用于计算每个年份和日数的平均NDVI值。最后,将所有年份和日数应用到reduceDaily函数中,生成逐日的NDVI值。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)