Skip to content

Commit

Permalink
Script cleanup
Browse files Browse the repository at this point in the history
- Make hex colors lower case
- Remove unnecessary `.0`
- Fix capitalization
- Remove unnecessary precision on locations
- Fix spacing after commas and colons
- `null` → `{}` for empty visualization args
- Fit to 80 columns

PiperOrigin-RevId: 539106948
  • Loading branch information
schwehr authored and copybara-github committed Jun 9, 2023
1 parent cf6f282 commit 7621482
Show file tree
Hide file tree
Showing 84 changed files with 289 additions and 288 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Map.addLayer(
'Hurricane Isaac - Inundation Extent');

// The duration (number of days a flood event lasted).
var durationPalette = ['C3EFFE', '1341E8', '051CB0', '001133'];
var durationPalette = ['c3effe', '1341e8', '051cb0', '001133'];
Map.addLayer(
hurricaneIsaacUsa.select('duration').selfMask(),
{min: 0, max: 4, palette: durationPalette},
Expand Down
6 changes: 3 additions & 3 deletions examples/JAXA/JAXA_ALOS_PALSAR_YEARLY_FNF.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ var dataset = ee.ImageCollection('JAXA/ALOS/PALSAR/YEARLY/FNF')
.filterDate('2017-01-01', '2017-12-31');
var forestNonForest = dataset.select('fnf');
var forestNonForestVis = {
min: 1.0,
max: 3.0,
palette: ['006400', 'FEFF99', '0000FF'],
min: 1,
max: 3,
palette: ['006400', 'feff99', '0000ff'],
};
Map.setCenter(136.85, 37.37, 4);
Map.addLayer(forestNonForest, forestNonForestVis, 'Forest/Non-Forest');
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Map.addLayer(
dataset.select('twprobabilityEnd'), {palette: plasma, min: 0, max: 100},
'twprobabilityEnd', false, 1);

var lossPalette = ['FE4A49'];
var gainPalette = ['2AB7CA'];
var lossPalette = ['fe4a49'];
var gainPalette = ['2ab7ca'];
Map.addLayer(
dataset.select('loss'), {palette: lossPalette, min: 1, max: 1},
'Tidal wetland loss', true, 1);
Expand All @@ -31,8 +31,8 @@ Map.addLayer(
dataset.select('gainYear'), {palette: viridis, min: 4, max: 19},
'Year of gain', false, 0.9);

// ecosystem type
var classPalette = ['9e9d9d', 'ededed', 'FF9900', '009966', '960000', '006699'];
// Ecosystem type.
var classPalette = ['9e9d9d', 'ededed', 'ff9900', '009966', '960000', '006699'];
var classNames =
['null', 'null', 'Tidal flat', 'Mangrove', 'null', 'Tidal marsh'];
Map.addLayer(
Expand Down
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LC08_C01_T1_32DAY_NBRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var colorized = dataset.select('NBRT');
var colorizedVis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
palette: ['000000', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LC08_C01_T1_32DAY_NDVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_32DAY_NDVI')
.filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('NDVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LC08_C01_T1_8DAY_EVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_8DAY_EVI')
.filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('EVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LC08_C01_T1_8DAY_NBRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var colorized = dataset.select('NBRT');
var colorizedVis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
palette: ['000000', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LC08_C01_T1_8DAY_NDSI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_8DAY_NDSI')
.filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('NDSI');
var colorizedVis = {
palette: ['000088', '0000FF', '8888FF', 'FFFFFF'],
palette: ['000088', '0000ff', '8888ff', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LC08_C01_T1_8DAY_NDVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_8DAY_NDVI')
.filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('NDVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LC08_C01_T1_ANNUAL_EVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_ANNUAL_EVI')
.filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('EVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LC08_C01_T1_ANNUAL_NBRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var colorized = dataset.select('NBRT');
var colorizedVis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
palette: ['000000', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LC08_C01_T1_ANNUAL_NDSI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_ANNUAL_NDSI')
.filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('NDSI');
var colorizedVis = {
palette: ['000088', '0000FF', '8888FF', 'FFFFFF'],
palette: ['000088', '0000ff', '8888ff', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LC08_C01_T1_ANNUAL_NDVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LC08/C01/T1_ANNUAL_NDVI')
.filterDate('2017-01-01', '2017-12-31');
var colorized = dataset.select('NDVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LE07_C01_T1_32DAY_EVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_32DAY_EVI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('EVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LE07_C01_T1_32DAY_NBRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var colorized = dataset.select('NBRT');
var colorizedVis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
palette: ['000000', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LE07_C01_T1_32DAY_NDVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_32DAY_NDVI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('NDVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LE07_C01_T1_8DAY_EVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_8DAY_EVI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('EVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LE07_C01_T1_8DAY_NBRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var colorized = dataset.select('NBRT');
var colorizedVis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
palette: ['000000', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LE07_C01_T1_8DAY_NDSI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_8DAY_NDSI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('NDSI');
var colorizedVis = {
palette: ['000088', '0000FF', '8888FF', 'FFFFFF'],
palette: ['000088', '0000ff', '8888ff', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LE07_C01_T1_8DAY_NDVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_8DAY_NDVI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('NDVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LE07_C01_T1_ANNUAL_EVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_ANNUAL_EVI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('EVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LE07_C01_T1_ANNUAL_NBRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var colorized = dataset.select('NBRT');
var colorizedVis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
palette: ['000000', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LE07_C01_T1_ANNUAL_NDSI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_ANNUAL_NDSI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('NDSI');
var colorizedVis = {
palette: ['000088', '0000FF', '8888FF', 'FFFFFF'],
palette: ['000088', '0000ff', '8888ff', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LE07_C01_T1_ANNUAL_NDVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LE07/C01/T1_ANNUAL_NDVI')
.filterDate('1999-01-01', '2002-12-31');
var colorized = dataset.select('NDVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LT04_C01_T1_32DAY_EVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LT04/C01/T1_32DAY_EVI')
.filterDate('1989-01-01', '1992-12-31');
var colorized = dataset.select('EVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LT04_C01_T1_32DAY_NBRT.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var colorized = dataset.select('NBRT');
var colorizedVis = {
min: 0.9,
max: 1.0,
palette: ['000000', 'FFFFFF'],
palette: ['000000', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
2 changes: 1 addition & 1 deletion examples/LANDSAT/LANDSAT_LT04_C01_T1_32DAY_NDSI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var dataset = ee.ImageCollection('LANDSAT/LT04/C01/T1_32DAY_NDSI')
.filterDate('1989-01-01', '1992-12-31');
var colorized = dataset.select('NDSI');
var colorizedVis = {
palette: ['000088', '0000FF', '8888FF', 'FFFFFF'],
palette: ['000088', '0000ff', '8888ff', 'ffffff'],
};
Map.setCenter(6.746, 46.529, 6);
Map.addLayer(colorized, colorizedVis, 'Colorized');
10 changes: 5 additions & 5 deletions examples/LANDSAT/LANDSAT_LT04_C01_T1_32DAY_NDVI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ var dataset = ee.ImageCollection('LANDSAT/LT04/C01/T1_32DAY_NDVI')
.filterDate('1989-01-01', '1992-12-31');
var colorized = dataset.select('NDVI');
var colorizedVis = {
min: 0.0,
max: 1.0,
min: 0,
max: 1,
palette: [
'FFFFFF', 'CE7E45', 'DF923D', 'F1B555', 'FCD163', '99B718', '74A901',
'66A000', '529400', '3E8601', '207401', '056201', '004C00', '023B01',
'012E01', '011D01', '011301'
'ffffff', 'ce7e45', 'df923d', 'f1b555', 'fcd163', '99b718', '74a901',
'66a000', '529400', '3e8601', '207401', '056201', '004c00', '023b01',
'012e01', '011d01', '011301'
],
};
Map.setCenter(6.746, 46.529, 6);
Expand Down
Loading

0 comments on commit 7621482

Please sign in to comment.