Skip to content

Commit

Permalink
feat(dataset): use correct colors for lakes.lswt legend image
Browse files Browse the repository at this point in the history
  • Loading branch information
pwambach committed Aug 29, 2022
1 parent 8869f03 commit b150117
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/layers-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
},
"lakes.lswt": {
"colorMap": "custom",
"basemap": "dark",
"timeFormat": {
"year": "numeric",
"month": "long"
Expand Down
2 changes: 1 addition & 1 deletion data/triggers/lakes_lswt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TIMEOUT=16000
LAYER_ID="lakes.lswt"
VARIABLE_ID="lswt"
LAYER_TYPE="image"
VERSION="1.7.1"
VERSION="1.8.1"
LON_RES="4320"
LAT_RES="2160"
ZOOM_LEVELS="0-3"
Expand Down
9 changes: 8 additions & 1 deletion scripts/generate-legend-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,18 @@ files.forEach(file => {
function readColorFile(file) {
const filePath = path.join(INTPUT_FOLDER, file);
const content = fs.readFileSync(filePath, 'utf8');
return content
const stops = content
.split('\n')
.filter(Boolean)
.filter(line => !line.startsWith('nv'))
.map(line => line.split(' '));

if (file.includes('lswt')) {
// do not include the "ice" color
return stops.filter(([v]) => v > -1000);
}
return stops;
}
function writeImage(file, canvas) {
Expand Down

0 comments on commit b150117

Please sign in to comment.