「Forest Monitoring for Action」(FORMA) 資料簡介

FORMA 是以 MODIS 為基礎的 500 x 500 公尺森林砍伐警示系統,每個月會針對潮濕的熱帶森林發出兩次警示。Earth Engine 中的 FORMA 500 資料集是一張圖片,其中包含自 2006 年 1 月起發布的快訊,且每月更新。每個快訊都有一個相關聯的時間,位於名為 alert_date 的單一頻帶中,單位為 Epoch 秒。依日期篩選 FORMA 資料,以及計算感興趣區域內的警示,是 FORMA 資料集最重要的兩項功能。

依日期篩選 FORMA

如要只顯示 2012 年發生的警示,請找出時間介於 2012 年第一天和 2013 年第一天之間的像素,以 1970 年 1 月 1 日午夜起的秒數表示:

程式碼編輯器 (JavaScript)

// Convert dates from milliseconds to seconds.
var start = ee.Date('2012-01-01').millis().divide(1000);
var end = ee.Date('2013-01-01').millis().divide(1000);

// Load the FORMA 500 dataset.
var forma = ee.Image('FORMA/FORMA_500m');

// Create a binary layer from the dates of interest.
var forma2012 = forma.gte(start).and(forma.lte(end));

Map.setCenter(15.87, -0.391, 7);
Map.addLayer(
  forma2012.mask(forma2012),
  {palette: ['FF0000']},
  'FORMA alerts in 2012'
);

在這個範例中,forma2012 是二進位圖片,僅包含 2012 年發生的像素 (也就是說,所有其他像素都已遮蓋)。

計算感興趣區域中的 FORMA 警示

如同我們在上一節使用 Hansen 等人的資料,我們可以先計算感興趣區域中的 FORMA 快訊 (像素) 數量。舉例來說,如要計算 2012 年剛果共和國保護區的警示數量,請以上一個範例為基礎,按照下列步驟操作:

程式碼編輯器 (JavaScript)

// Load country features from Large Scale International Boundary (LSIB) dataset.
var countries = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017');

// Subset the Congo Republic feature from countries.
var congo = ee.Feature(
  countries
    .filter(ee.Filter.eq('country_na', 'Rep of the Congo'))
    .first()
);

// Subset protected areas to the bounds of the congo feature
// and other criteria. Clip to the intersection with congo.
var protectedAreas = ee.FeatureCollection('WCMC/WDPA/current/polygons')
  .filter(ee.Filter.and(
    ee.Filter.bounds(congo.geometry()),
    ee.Filter.neq('IUCN_CAT', 'VI'),
    ee.Filter.neq('STATUS', 'proposed'),
    ee.Filter.lt('STATUS_YR', 2010)
  ))
  .map(function(feat){
    return congo.intersection(feat);
  });

// Display protected areas on the map.
Map.addLayer(
  protectedAreas,
  {color: '000000'},
  'Congo Republic protected areas'
);

// Calculate the number of FORMA pixels in protected
// areas of the Congo Republic, 2012.
var stats = forma2012.reduceRegion({
  reducer: ee.Reducer.sum(),
  geometry: protectedAreas.geometry(),
  scale: 500
});
print('Number of FORMA pixels, 2012: ', stats.get('constant'));

計算多個感興趣區域的 FORMA 警示

到目前為止,我們一次只計算一個區域的統計資料。如要一次計算多個區域的統計資料,可以使用 reduceRegions()。再次以上一個範例為基礎:

程式碼編輯器 (JavaScript)

var regionsStats = forma2012.reduceRegions({
  collection: protectedAreas,
  reducer: ee.Reducer.sum(),
  scale: forma2012.projection().nominalScale()
});
print(regionsStats);

檢查輸出至控制台的物件,並觀察 reduceRegions() 的輸出結果是另一個 FeatureCollection。請注意,剛果共和國保護區集合中的每個區域現在都有一個額外屬性 sum,以縮減器命名。這個屬性的值是減縮器的輸出內容,也就是保護區中 2012 年的警示數量。

FORMA 和 Hansen 等人資料集的比較

如要比較 FORMA 和 Hansen 等人的資料集,可以使用邏輯運算子。 (進一步瞭解邏輯運算)。具體來說,我們想製作一張圖片,其中 FORMA 和 Hansen 等人的資料都標示為森林砍伐的像素為 1,其餘為 0。這段程式碼會建立 2012 年的這類圖片,並與其他預測的森林砍伐圖層一併顯示:

程式碼編輯器 (JavaScript)

// Convert dates from milliseconds to seconds.
var start = ee.Date('2012-01-01').millis().divide(1000);
var end = ee.Date('2013-01-01').millis().divide(1000);
var region = ee.Geometry.Rectangle([-59.81163, -9.43348, -59.27561, -9.22818]);

// Load the FORMA 500 dataset.
var forma = ee.Image('FORMA/FORMA_500m');

// Create a binary layer from the dates of interest.
var forma2012 = forma.gte(start).and(forma.lte(end));

// Load Hansen et al. data and get change in 2012.
var gfc = ee.Image('UMD/hansen/global_forest_change_2015');
var gfc12 = gfc.select(['lossyear']).eq(12);

// Create an image which is one where the datasets
// both show deforestation and zero elsewhere.
var gfc_forma = gfc12.eq(1).and(forma2012.eq(1));

// Display data on the map.
Map.setCenter(-59.58813, -9.36439, 11);
Map.addLayer(forma.updateMask(forma), {palette: '00FF00'}, 'Forma (green)');
Map.addLayer(gfc12.updateMask(gfc12), {palette: 'FF0000'}, 'Hansen (red)');
Map.addLayer(
  gfc_forma.updateMask(gfc_forma),
  {palette: 'FFFF00'},
  'Hansen & FORMA (yellow)'
);

以上就是 Earth Engine 森林變化資料集的總覽。期待您運用這些功能大顯身手!