FORMA は、MODIS ベースの 500 x 500 メートルの、湿潤熱帯林を対象とした森林伐採アラート システムで、月に 2 回更新されます。Earth Engine の FORMA 500 データセットは、2006 年 1 月からアラートが開始され、毎月更新される画像です。各アラートには、alert_date という名前の単一のバンドにエポック秒単位で関連付けられた時間があります。FORMA データセットでできる最も重要なこととして、FORMA を日付でフィルタすることと、関心のある地域内のアラートを計算することが挙げられます。
FORMA を日付でフィルタする
2012 年に発生したアラートのみを表示するには、2012 年の最初の日から 2013 年の最初の日までの時間を持つピクセルを見つけます。これは、1970 年 1 月 1 日の午前 0 時からの秒数で表されます。
コードエディタ(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 et al. のデータに対して行ったように、関心のある地域内の 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 アラートのカウント
これまでは、一度に 1 つのリージョンで統計情報を計算してきました。複数のリージョンの統計情報を一度に計算するには、reduceRegions() を使用します。前の例を基にすると、次のようになります。
コードエディタ(JavaScript)
var regionsStats = forma2012.reduceRegions({ collection: protectedAreas, reducer: ee.Reducer.sum(), scale: forma2012.projection().nominalScale() }); print(regionsStats);
コンソールに出力されたオブジェクトを調べ、reduceRegions() の出力が別の FeatureCollection であることを確認します。コンゴ共和国の保護地域のコレクション内のすべてのリージョンに、レデューサにちなんで名付けられた sum という追加のプロパティが追加されています。このプロパティの値は、レデューサの出力、つまり保護エリア内の 2012 年のアラートの数です。
FORMA と Hansen et al. のデータセットの比較
FORMA と Hansen et al. のデータセットを比較するには、論理演算子を使用します。 (論理演算の詳細)。具体的には、FORMA と Hansen et al. の両方のデータで森林伐採としてマークされたピクセルが 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 の森林変化データセットの概要は終わりです。皆様がこれらの機能をどのように活用されるか楽しみにしております。