本此主要是讲解镶嵌,其实比较简单:
mosaic()
Composites all the images in a collection, using the mask. Arguments: this:collection (ImageCollection):The collection to mosaic.
Returns: Image
代码:
//加载2012年一年的影像,因为你的矩形涉及到四幅影像所以一会会根据这个进行拼接
var geo=ee.Geometry.Rectangle(-71.17965, 42.35125, -71.08824, 42.40584)
print("geo",geo)
var naip2012 = ee.ImageCollection('USDA/NAIP/DOQQ')
.filterBounds(geo)
.filterDate('2012-01-01', '2012-12-31');
print("naip2012",naip2012)
// 根据矩形的四点的坐标进行镶嵌
var mosaic = naip2012.mosaic();
Map.setCenter(-71.12532, 42.3712, 12);
Map.addLayer(mosaic, {}, 'spatial mosaic');
Map.addLayer(geo, {}, 'geo');