FORMA는 MODIS를 기반으로 하며, 습한 열대 우림을 대상으로 500x500m 단위로 한 달에 두 번 삼림 벌채 알림을 제공하는 시스템입니다. Earth Engine의 FORMA 500 데이터 세트는 2006년 1월부터 시작하여 매월 업데이트되는 알림이 포함된 이미지입니다. 각 알림에는 epoch 초 단위로 alert_date라는 단일 대역에 연결된 시간이 있습니다. 날짜별로 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 et al. 데이터 세트 비교
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의 산림 변화 데이터 세트에 대한 개요를 마치겠습니다. 이러한 기능을 활용해 어떤 성과를 거두실지 기대됩니다.