Skip to content

Commit

Permalink
updated stats & examples
Browse files Browse the repository at this point in the history
  • Loading branch information
samapriya committed Sep 9, 2024
1 parent 6a3ac8b commit 9375b89
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**** Start of imports. If edited, may not auto-convert in the playground. ****/
var csi_great_basin = ee.ImageCollection("projects/sat-io/open-datasets/CSI/Great_Basin");
/***** End of imports. If edited, may not auto-convert in the playground. *****/

var mosaic = csi_great_basin.mosaic();

var palette = [
'FF0000',
'FFA500',
'FFFF00',
'ADFF2F',
'008000'
];

var visParams = {
min: -1,
max: 1,
palette: palette
};

Map.centerObject(csi_great_basin.first(),6)

Map.addLayer(mosaic.select('CSI'), visParams, 'Great Basin Carbon Security Index');

var snazzy = require("users/aazuspan/snazzy:styles");
snazzy.addStyle("https://snazzymaps.com/style/15/subtle-grayscale", "Greyscale");

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ Map.addLayer(gmw_core_raster,{"opacity":1,"bands":["b1"],"min":1,"max":1,"palett
//Tiles
var tiles = ee.FeatureCollection("projects/earthengine-legacy/assets/projects/sat-io/open-datasets/GMW/gmw_v3_tiles");
Map.addLayer(ee.Image().paint(tiles,0,3), {"palette":["#000000"]}, 'Tiles')

//Extent v4
var raster_extent = ee.ImageCollection("projects/sat-io/open-datasets/GMW/annual-extent/GMW_MNG_2020");
var vector_extent = ee.FeatureCollection("projects/sat-io/open-datasets/GMW/annual-extent/GMW_MNG_VEC_2020");
Map.addLayer(raster_extent.median(),{"opacity":1,"bands":["b1"],"min":1,"max":1,"palette":["228B22"]},'GMW Raster Extent 2020 v4.0.19')
Map.addLayer(ee.Image().paint(vector_extent,0,3), {"palette":["red"]}, 'GMW Vector Extent 2020 v4.0.19')

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/**** Start of imports. If edited, may not auto-convert in the playground. ****/
var peatland_db = ee.Image("projects/sat-io/open-datasets/GLOBAL-PEATLAND-DATABASE"),
peatland_extent = ee.Image("projects/sat-io/open-datasets/ML-GLOBAL-PEATLAND-EXTENT");
var peatland_db = ee.Image("projects/sat-io/open-datasets/GLOBAL-PEATLAND-DATABASE");
/***** End of imports. If edited, may not auto-convert in the playground. *****/

// Load administrative boundaries for Indonesia
var admin1 = ee.FeatureCollection("projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM1");
var geometry = admin1.filter(ee.Filter.eq('shapeGroup', 'IDN'));
Expand All @@ -19,6 +17,4 @@ var peat = peatland_db //.clip(geometry)
Map.addLayer(peat.clip(geometry),
{min: 0, max: 1, palette: ['#f7fcf5', '#c7e9c0', '#74c476', '#238b45', '#00441b']},
'Peatland Distribution', true
);
Map.addLayer(peatland_extent,{palette: ['#f7fcf5', '#c7e9c0', '#74c476', '#238b45', '#00441b']},
'Peatland Distribution', true);
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Load administrative boundaries for Indonesia
var admin1 = ee.FeatureCollection("projects/sat-io/open-datasets/geoboundaries/HPSCGS-ADM1");
var geometry = admin1.filter(ee.Filter.eq('shapeGroup', 'IDN'));

Map.centerObject(geometry, 4);
Map.setOptions("Hybrid");

var peat = ee.Image("projects/sat-io/open-datasets/ML-GLOBAL-PEATLAND-EXTENT")
.clip(geometry)
.unmask();

// Display the results
Map.addLayer(peat.clip(geometry),
{min: 0, max: 100, palette: ['#f7fcf5', '#c7e9c0', '#74c476', '#238b45', '#00441b']},
'Peatland Distribution', true
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var carbonoffsetscol = ee.FeatureCollection('projects/sat-io/open-datasets/CARBON-OFFSET-PROJECTS-GLOBAL');

var visParams = {
palette: ['#9ab555'],
min: 0.0,
max: 1550000.0,
opacity: 0.8,
};
var carbonoffsets = ee.Image().float().paint(carbonoffsetscol, 'REP_AREA');

Map.setCenter(-52.692,-2.628,6)
Map.addLayer(carbonoffsets, visParams, 'Existing carbon projects area');

var snazzy = require("users/aazuspan/snazzy:styles");
snazzy.addStyle("https://snazzymaps.com/style/15/subtle-grayscale", "Greyscale");
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@

var snazzy = require("users/aazuspan/snazzy:styles");
snazzy.addStyle("https://snazzymaps.com/style/15/subtle-grayscale", "Greyscale");


// load the population density
var popDensity = ee.Image("projects/ee-nandometzger/assets/POPCORNv1");

// Define the inferno color palette
var infernoPalette = [
'#000004', '#1b0c41', '#4a0c6b', '#781c81', '#a52c7a', '#cf4446',
'#ed721c', '#fb9b06', '#f7d03c', '#fcffa4'
];

// Define visualization parameters.
var visParams = {
min: 0,
max: 4,
palette: infernoPalette,
opacity: 0.8 // 70% transparent
};


// Mask out the lowest values (e.g., less than a certain threshold)
var threshold = 0.08;
var maskedPopDensity = popDensity.updateMask(popDensity.gt(threshold));

// Add the masked population density layer to the map.
Map.addLayer(maskedPopDensity, visParams, 'Population Density');

// Create a legend
var legend = ui.Panel({
style: {
position: 'bottom-right',
padding: '8px 15px',
}
});

// Create legend title
var legendTitle1 = ui.Label({
value: 'POPCORN',
style: {
fontWeight: 'bold',
fontSize: '32px',
margin: '0 0 4px 0',
padding: '0'
}
});

legend.add(legendTitle1);

// Create another legend title
var legendTitle2 = ui.Label({
value: 'Population Density [People/ha]',
style: {
fontWeight: 'bold',
fontSize: '18px',
margin: '0 0 4px 0',
padding: '0'
}
});

legend.add(legendTitle2);

// Create a continuous color legend
var legendImage = ui.Thumbnail({
image: ee.Image.pixelLonLat().select(0),
params: {
bbox: [0, 0, 1, 0.1],
dimensions: '300x15',
format: 'png',
min: 0,
max: 1,
palette: infernoPalette,
},
style: { margin: '0 0 4px 0' },
});

legend.add(legendImage);

// Create labels for min and max values
var minLabel = ui.Label(visParams.min.toString(), { margin: '0 269px 4px 0' });
var maxLabel = ui.Label(visParams.max.toString(), { margin: '0 0 4px 0' });

// Add labels to the legend
var labelsPanel = ui.Panel([minLabel, maxLabel], ui.Panel.Layout.flow('horizontal'));
legend.add(labelsPanel);
Map.setControlVisibility({all: false});

// Add the legend to the map
Map.add(legend);

// Center map for the rwanda/DRC boarder scene
Map.setCenter(29.244453536522037, -1.6857641047022471, 13); // The third parameter is the zoom level.

4 changes: 2 additions & 2 deletions docs/stats.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Catalog Stats

#### Last updated 2024-08-04
#### Last updated 2024-09-08

![GEE Community Datasets](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/samapriya/34bc0c1280d475d3a69e3b60a706226e/raw/community.json)
![GitHub Release](https://img.shields.io/github/v/release/samapriya/awesome-gee-community-datasets)


![catalog_stats_20240804](https://github.com/user-attachments/assets/e8c8c69e-0d22-4773-b457-6cf601bf219b)
![catalog_stats_20240908](https://github.com/user-attachments/assets/0a08236d-81fc-4919-86cb-0ab07c2f7d93)

0 comments on commit 9375b89

Please sign in to comment.