珠海门户网站建设多少钱,网页设计公司创业计划书,如何免费做网页,上海外贸上市公司有哪些本文记录了在GEE平台上标记样本的技巧和代码脚本#xff0c;样本点可以用来做土地利用分类、植被提取、水藻提取、冰川提取、农作物提取等应用中。可以应用到的方法包括随机森林#xff08;RF#xff09;分类#xff0c;支持矢量机#xff08;SVM#xff09;分类#xf…本文记录了在GEE平台上标记样本的技巧和代码脚本样本点可以用来做土地利用分类、植被提取、水藻提取、冰川提取、农作物提取等应用中。可以应用到的方法包括随机森林RF分类支持矢量机SVM分类决策树分类等机器学习分类方法中。 文章目录一、样本点选择结果展示二、代码脚本三、样本创建教程1、创建 FeatureCollection2、新增属性 Property3选择样本点4、合并样本一、样本点选择结果展示 二、代码脚本
代码加入了加彩色合成影像用于参考当然可以选择Landsat、哨兵、MODIS或者多种参考数据进行辅助标记。 代码链接https://code.earthengine.google.com/275689210a495ca40bcfbca5dac9fc99?noloadtrue
var roi table
Map.centerObject(roi, 6);
//设置显示样式color代表边界颜色fillcolor代表填充颜色
var styling{color:red,fillColor:00000000}
//roi就是矢量边界
Map.addLayer(roi.style(styling),{},roi)var startDate ee.Date(2019-01-01);
var endDate ee.Date(2019-12-31);// Visualize the Landsat image
var landsatCollection ee.ImageCollection(LANDSAT/LC08/C01/T1).filterDate(startDate, endDate).filterBounds(roi).filterMetadata(CLOUD_COVER_LAND, less_than, 30);
print(landsatCollection,landsatCollection)// Make a cloud-free composite.
var composite ee.Algorithms.Landsat.simpleComposite({collection: landsatCollection,asFloat: true
});
print(composite, composite)
// Visualize the Composite
Map.addLayer(composite, {bands: [B6, B5, B4], max: 0.5, gamma: 2}, L8 Image, true);// Visualize the Sentinel-2 image
var s2img ee.ImageCollection(COPERNICUS/S2_SR).filterDate(startDate, endDate).filterBounds(roi).map(maskS2clouds).mean();// Remove cloud
function maskS2clouds(image) {var qa image.select(QA60);// Bits 10 and 11 are clouds and cirrus, respectively.var cloudBitMask 1 10;var cirrusBitMask 1 11;// Both flags should be set to zero, indicating clear conditions.var mask qa.bitwiseAnd(cloudBitMask).eq(0).and(qa.bitwiseAnd(cirrusBitMask).eq(0));return image.updateMask(mask).divide(10000);
}var visualization {min: 0.0,max: 0.4,bands: [B11, B8, B4],//分别对应SWIR1,NIR,RED波段
};
Map.addLayer(s2img, visualization, 假彩色);// Merge points together
var sampleCollection constructionland.merge(forest).merge(cultivatedland).merge(water).merge(unusedland).merge(grassland);
print(sampleCollection , Sample Collection)三、样本创建教程
1、创建 FeatureCollection
第一步点击地图视图区域的红框new layer按钮新增FeatureCollection。 第二步点击红框齿轮部分进入属性修改界面。 2、新增属性 Property
在属性修改界面可以修改样本要素的名字格式选择FeaturCollection显示颜色可以在颜色条中选择Property属性波段名写为landcocer值设置为1不同类型样本的landcover值不应该一样。 3选择样本点
选中红框forest然后使用红色箭头所指的工具在地图上选择点。 4、合并样本
// Merge points together
var sampleCollection constructionland.merge(forest).merge(cultivatedland).merge(water).merge(unusedland).merge(grassland);
print(sampleCollection , Sample Collection )