GEE組合圖像,邊界裁切

標(biāo)記特定像素

主要功能

獲取一特定時間段內(nèi)所有數(shù)據(jù)的集合,計算所有數(shù)據(jù)的中值,篩選矢量數(shù)據(jù),完成數(shù)據(jù)裁剪

代碼

// Composite an image collection and clip it to a boundary.

// Load Landsat 7 raw imagery and filter it to April-July 2000.
var collection = ee.ImageCollection('LANDSAT/LE07/C01/T1')
    .filterDate('2000-04-01', '2000-07-01');

// Reduce the collection by taking the median.
var median = collection.median();

// Load a table of state boundaries and filter.
var fc = ee.FeatureCollection('TIGER/2016/States')
    .filter(ee.Filter.or(
        ee.Filter.eq('NAME', 'Nevada'),
        ee.Filter.eq('NAME', 'Arizona')));

// Clip to the output image to the Nevada and Arizona state boundaries.
var clipped = median.clipToCollection(fc);

// Display the result.
Map.setCenter(-110, 40, 5);
var visParams = {bands: ['B3', 'B2', 'B1'], gain: [1.4, 1.4, 1.1]};
Map.addLayer(clipped, visParams, 'clipped composite');

步驟分析

  1. 生成數(shù)據(jù)集對象,使用數(shù)據(jù)名稱來加載特定數(shù)據(jù)
  2. 計算數(shù)據(jù)集中值
  3. 創(chuàng)建特征數(shù)據(jù)集對象,使用數(shù)據(jù)名稱加載數(shù)據(jù)
  4. 使用特征名稱來篩選數(shù)據(jù)集,獲取矢量邊界
  5. 裁剪數(shù)據(jù)集
  6. 設(shè)置地圖中心,縮放等級
  7. 設(shè)置圖層顯示參數(shù)
  8. 加載圖層,重命名圖層

主要方法

  1. ee.ImageCollection()
    ImageCollections can be constructed from the following arguments:
  • A string: assumed to be the name of a collection,
  • A list of images, or anything that can be used to construct an image.
  • A single image.
  • A computed object - reinterpreted as a collection.
    Arguments:
    args (ComputedObject|Image|List<Object>|String):
    The constructor arguments.
    Returns: ImageCollection

創(chuàng)建影像數(shù)據(jù)集。影像數(shù)據(jù)集可以使用四種參數(shù)來創(chuàng)建,字符串(數(shù)據(jù)集名稱),列表(圖像的列表,或者可以創(chuàng)建圖像的列表),單獨的一幅影像,計算結(jié)果(轉(zhuǎn)換為數(shù)據(jù)集)
輸入?yún)?shù):創(chuàng)建影像數(shù)據(jù)集對象參數(shù)

  1. ee.ImageCollection.median()
    Reduces an image collection by calculating the median of all values at each pixel across the stack of all matching bands. Bands are matched by name.
    Arguments:
    this:collection (ImageCollection):
    The image collection to reduce.
    Returns: Image

計算影像數(shù)據(jù)集的中值
輸入?yún)?shù):影像數(shù)據(jù)集

  1. ee.FeatureCollection()
    FeatureCollections can be constructed from the following arguments:
  • A string: assumed to be the name of a collection.
  • A single geometry.
  • A single feature.
  • A list of features.
  • A computed object: reinterpreted as a collection.
    Arguments:
    args (ComputedObject|Feature|FeatureCollection|Geometry|List<Object>|Number|String):
    The constructor arguments.
    column (String, optional):
    The name of the geometry column to use. Only useful with constructor type 1.
    Returns: FeatureCollection

創(chuàng)建一個要素數(shù)據(jù)集,可以使用五種參數(shù)來創(chuàng)建:符串(數(shù)據(jù)集名稱),單獨的一個地理對象,單獨的一個要素,要素列表,計算結(jié)果(轉(zhuǎn)換為數(shù)據(jù)集)
輸入?yún)?shù):影像數(shù)據(jù)集,屬性列表

  1. ee.Image.clipToCollection()
    Clips an image to a FeatureCollection. The output bands correspond exactly the input bands, except data not covered by the geometry of at least one feature from the collection is masked. The output image retains the metadata of the input image.
    Arguments:
    this:input (Image):
    The image to clip.
    collection (Object):
    The FeatureCollection to clip to.
    Returns: Image

影像按照要素集進行裁切。輸入?yún)?shù):影像對象,要素集(裁切邊界)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,858評論 0 10
  • 那年十二歲 為了一件新衣 跟媽媽吵了一夜 第一次發(fā)現(xiàn) 原來自己這么能堅持 還這么雄辯 最后媽媽投降了 我覺得 不是...
    依儂a閱讀 148評論 0 3
  • 對于睡覺,一直信任睡眠8小時論,有時晚上睡得晚了,心里也會大概算一下能睡幾小時,結(jié)果好心辦壞事,睡不著了,...
    小惠_f2b8閱讀 325評論 5 1
  • 我的酸、甜、苦葡萄.甚是可口.g.n
    益達酸甜苦辣閱讀 300評論 0 0
  • 你帶著朝霞來 我?guī)еB鳴去 露珠落在我們的發(fā)上 花香沾滿我們的衣袖 我們在林中走一走 唱一首外國的歌 他逆瀑而上 ...
    高屋建瓴vs明懿閱讀 204評論 0 2

友情鏈接更多精彩內(nèi)容