Skip to content

Instantly share code, notes, and snippets.

@geografif
Created April 29, 2024 01:34
Show Gist options
  • Save geografif/de563a232c3455376acbee3fb399e6ca to your computer and use it in GitHub Desktop.
Save geografif/de563a232c3455376acbee3fb399e6ca to your computer and use it in GitHub Desktop.
var canopyHeight = ee.ImageCollection('projects/meta-forest-monitoring-okw37/assets/CanopyHeight').mosaic();
var treenotree = canopyHeight.updateMask(canopyHeight.gte(1))
//// viz settings ////
var palettes = require('users/gena/packages:palettes');
///Our layers///
Map.addLayer(treenotree, {
min: 0,
max: 1,
palette: ['440154', 'fde725']
}, 'Canopy height (>=1 meter)', false);
Map.addLayer(canopyHeight, {
min: 0,
max: 25,
palette: palettes.matplotlib.viridis[7]
}, 'Canopy Height [meters]');
///Default location and zoom///
//Map.setCenter(0, 10, 3)
Map.centerObject(aoi);
//Export based on 'AOI' extent
Export.image.toDrive({
image: canopyHeight.clip(aoi),
description: 'chm',
region: aoi,
scale: 1,
crs: 32748,
maxPixels: 1e13
});
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment