Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETH Global Sentinel-2 10m Canopy Height (2020) #274

Closed
1 task done
pinkychow1010 opened this issue Jul 27, 2024 · 1 comment
Closed
1 task done

ETH Global Sentinel-2 10m Canopy Height (2020) #274

pinkychow1010 opened this issue Jul 27, 2024 · 1 comment
Assignees

Comments

@pinkychow1010
Copy link

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

// 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

  • I agree to follow this project's Code of Conduct
@samapriya
Copy link
Owner

Hi @pinkychow1010
Thank you so much for these tutorials but as I cannot use them with the data corruption I am going ahead and closing these issues. As and when these get fixed I am more than happy to include them in the tutorials and thank you so much for contributing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants