// This script combines the canopy height data with road assessibility to address vulnerable tall forest in Brazil
// load study area
var admin1 = ee.FeatureCollection("projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM1");
var geometry = admin1.filter(ee.Filter.eq('shapeGroup', 'BRA'));
// Center the map on the geometry and set the base map options
Map.centerObject(geometry);
Map.setOptions("Hybrid");
// create a tall forest mask for trees higher than 10 m
var canopy_height = ee.Image("users/nlang/ETH_GlobalCanopyHeight_2020_10m_v1");
var forest_mask = canopy_height.gt(10);
var ch_vis = {
min: 0,
max: 30,
palette: ['white','green']
};
// visualize canopy height for reference
Map.addLayer(canopy_height.clip(geometry), ch_vis, "Canopy Height", false);
// Load and preprocess the land-based travel speed image
var landBasedTravelSpeed = ee.Image('Oxford/MAP/friction_surface_2019')
.select('friction')
.clip(geometry);
var travelSpeedVisParams = {
min: 0.005,
max: 0.02,
palette: ['#FF0000', '#FFFF00', '#00FF00', '#0000FF'] // Red to Blue gradient
};
// Add the land-based travel speed layer
Map.addLayer(landBasedTravelSpeed, travelSpeedVisParams, 'Land-based travel speed', false);
// Load the forest loss data
var loss = ee.Image('UMD/hansen/global_forest_change_2023_v1_11').select('lossyear');
var treeLossVisParams = {
min: 0,
max: 23,
palette: ['white', 'red']
};
// Add layers for tree loss before and after 2019 for comparison on vulnerability mapping
Map.addLayer(loss.clip(geometry).updateMask(loss.lt(20)), treeLossVisParams, 'Tree Loss before 2019', false, 0.5);
Map.addLayer(loss.clip(geometry).updateMask(loss.gt(18)), treeLossVisParams, 'Tree Loss after 2019 onwards', false, 0.9);
// Define urban areas as the source for cost surface calculation
var urbanAreas = ee.ImageCollection('projects/sat-io/open-datasets/ORNL/LANDSCAN_GLOBAL')
.sort('system:time_start', false)
.first()
.gt(10)
.clip(geometry);
// Compute the cumulative cost surface from urban areas
var costSurface = landBasedTravelSpeed.cumulativeCost({
source: urbanAreas,
maxDistance: 500000, // Maximum distance in meters
geodeticDistance: true
}).clip(geometry);
// Define visualization parameters for the cost surface layer
var costSurfaceVisParams = {
min: 3,
max: 8,
palette: [
'black', // Very high cost - Black
'#FF0000', // High cost - Red
'#FFA500', // Medium cost - Orange
'#FFD700', // Low-Medium cost - Yellow
'#ADFF2F', // Low cost - Green-Yellow
'#00FF00' // Very Low cost - Green
]
};
// Add the cost surface layer to the map, masked by forest cover
Map.addLayer(
costSurface.log().updateMask(forest_mask),
costSurfaceVisParams,
'Cost Model'
);
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Contact Details
pinkychow1010@gmail.com
Provide Dataset Link
https://gee-community-catalog.org/projects/canopy/?h=canopy+height
Describe the example
Forest vulnerability mapping in Brazil
Code of Conduct