用法 | 方法 |
---|---|
创建 | GEE自带、用户上传、ee.Image()/constant()、ee.Image.pixelLonLat |
编辑 | mask、clip、select、slice、addBands、reproject、rbgtohsv、hsvtorbg、unit8、cast、set、setMulti、remap、where、metadata、clmap、unitScale、interpolate、eq、abs、sin、bitWiseAnd、reduce |
地形 | image.dericative、ee.Terrain.products、ee.Algorithm.Terrain、ee.Terrain.slope、ee.Terrain.aspect、ee.Terrain.fillMinima、ee.Terrain.hillshade、ee.Terrain.hillshadow、ee.Algorithm.Hillshadow |
纹理 | entropy、Texture、zeroCrossing、ee.Algorithms.CannyEdgeDectector、ee.Algorithms.HoughTransform |
邻域 | focal_max、focal_min、focal_median、focal_mode、convolve、reduceNeighborhood |
转换 | Image.ToVector、Image.ToArray、Image.arrayFlatten |
其他 | CrossCorrelation、distance、Export.image |
Landset,Sentinel,Srtm,Land Cover
var Image1 = ee.Image(10)
var Image2 = ee.Image.constant(20)
var Image3 = Image1.add(Image2)
print(Image1,Image2,Image3)
var Image_Lon_lat = ee.Image.pixelLonLat()
print(Image_Lon_lat)
Map.addLayer(Image_Lon_lat, {bands:['longitude'],min:-180,max:180},'Longitude')
Map.addLayer(Image_Lon_lat, {bands:['latitude'], min:-60,max:60},'Latitude')
Map.setCenter(0,0,3)
var Image_DEM = ee.Image('CGIAR/SRTM90_V4')
var Image_CropLand = ee.Image("ESA/GLOBCOVER_L4_200901_200912_V2_3").select('landcover').eq(11)
var Image_Masked = Image_DEM.mask(Image_CropLand)
print(Image_DEM,Image_CropLand,Image_Masked)
Map.setCenter(106.4,34.78,4)
Map.addLayer(Image_DEM,{"opacity":1,"bands":["elevation"],"min":0,"max":1400,
"palette":["2dff07","ff0b0b"]},'Image_DEM')
Map.addLayer(Image_CropLand,{"opacity":1,"bands":["landcover"],
"palette":["ffffff","fbff2d"]},'Image_CropLand')
Map.addLayer(Image_Masked,{"opacity":1,"bands":["elevation"],"min":0,"max":1400,
"palette":["2dff07","ff0b0b"]},'Image_Masked')
opacity:不透明度
var DEM = ee.Image("USGS/SRTMGL1_003")
var wuhan = ee.FeatureCollection("users/szliu1120/hubei")
.filterBounds(ee.Geometry.Point([114.522029,30.510227]))
var wuhan_DEM = DEM.clip(wuhan)
Map.setCenter(114.522029,30.510227)
Map.addLayer(wuhan_DEM,{min:0, max:200})
mask:栅格对栅格;clip:矢量对栅格
var Glob_Cover = ee.Image("ESA/GLOBCOVER_L4_200901_200912_V2_3")
var Land_cover = Glob_Cover.select('landcover')
var Land_cover_quality = Glob_Cover.select('qa')
Map.setCenter(107.56,34.79,4)
Map.addLayer(Land_cover)
Map.addLayer(Land_cover_quality)
用于挑选某个数据集中,需要的某几个波段
var L8 = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
var L8_One = ee.Image(L8.filterBounds(ee.Geometry.Point(106.4958,29.5856)).first())
var L8_Slice = L8_One.slice(2,5) // 2不包含,5包含
print(L8_One,L8_Slice)
var L8 = ee.ImageCollection("LANDSAT/LC08/C02/T1_L2")
var L8_One = ee.Image(L8.filterBounds(ee.Geometry.Point(106.4958,29.5856)).first())
var L8_B5 = L8_One.select('SR_B5')
var L8_B4 = L8_One.select('SR_B4')
var L8_B5_4 = L8_B5.addBands(L8_B4)
print(L8_B5,L8_B4,L8_B5_4)
var L8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_RT")
var L8_One = ee.Image(L8.filterBounds(ee.Geometry.Point(106.4958,29.5856)).first())
var L8_Reproject = L8_One.reproject('EPSG:3857',null,100)
print(L8_One)
print(L8_One.select('B1').projection(), L8_Reproject.projection())
Map.setCenter(106.58365,29.56972,15)
Map.addLayer(L8_One,{"bands":["B5","B4","B3"],"min":10586,"max":18154},"30m")
Map.addLayer(L8_Reproject,{"bands":["B5","B4","B3"],"min":10586,"max":18154},"100m")
对多波段图像进行相关操作
var L8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_RT")
var L8_One = ee.Image(L8.filterBounds(ee.Geometry.Point(106.4958,29.5856)).first())
.slice(2,5).unitScale(0,32468)
var L8_Cast = L8_One.cast({'B5':'double','B4':'double','B3':"double"},['B5','B4','B3'])
print(L8_One, L8_Cast)
var L8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_RT")
var L8_One = ee.Image(L8.filterBounds(ee.Geometry.Point(106.4958,29.5856)).first())
.slice(2,5).unitScale(0,32468)
var L8_HSV = L8_One.rgbToHsv().set('note',"This image was created by 'rgbToHsv()'")
.setMulti({'author':'szliu','Mood':'Not bad'})
print(L8_HSV)
对栅格图像在属性上的重分类
先投影为投影坐标系
当像元之间以m为单位时,坡度才有意义
方位角、太阳高度角
指定一个搜索半径,发现某个值符合搜索定义,就将这个值定义为整个邻域的所有值
ee.ImageCollection.fromImages()