מבוא לנתוני Forest Monitoring for Action (FORMA)

‫FORMA היא מערכת התרעות על כריתת יערות ביערות טרופיים לחים, שפועלת פעמיים בחודש ומבוססת על MODIS בגודל 500 על 500 מטר. קבוצת הנתונים FORMA 500 ב-Earth Engine היא תמונה עם התראות החל מינואר 2006, שמתעדכנת מדי חודש. לכל התראה יש זמן שמשויך אליה ברצועה אחת בשם alert_date ביחידות של שניות מתחילת התקופה. סינון של FORMA לפי תאריכים וחישוב התראות באזורי עניין הם שניים מהדברים הכי חשובים שאפשר לעשות עם מערך הנתונים של FORMA.

סינון FORMA לפי תאריך

כדי להציג רק את ההתראות שהתרחשו בשנת 2012, צריך למצוא פיקסלים שהזמנים שלהם הם בין היום הראשון של 2012 ליום הראשון של 2013, מבוטאים בשניות מאז חצות, 1 בינואר 1970:

Code Editor (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, אפשר להרחיב את הדוגמה הקודמת באופן הבא:

Code Editor (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(). נמשיך עם הדוגמה הקודמת:

Code Editor (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 ומציג אותה יחד עם שכבות אחרות של חיזוי כריתת יערות:

Code Editor (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. אנחנו כבר ממש סקרנים לראות מה אפשר לעשות איתם.