chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2024-10-19 14:44:55 +02:00
parent c9ce29f206
commit 40e894df8b
294 changed files with 14209 additions and 4192 deletions

View file

@ -98,24 +98,21 @@ class DownloadEli extends Script {
}
layer = { properties: layer.properties, type: layer.type, geometry: layer.geometry }
if(layer.geometry === null){
if (layer.geometry === null) {
keptGlobalLayers.push(layer)
}else{
} else {
keptLayers.push(layer)
}
}
const contents =
'{"type":"FeatureCollection",\n "features": [\n' +
keptLayers
.map((l) => JSON.stringify(l))
.join(",\n") +
keptLayers.map((l) => JSON.stringify(l)).join(",\n") +
"\n]}"
const contentsGlobal =
keptGlobalLayers
.filter((l) => l.properties.id !== "Bing")
.map(l => l.properties)
const contentsGlobal = keptGlobalLayers
.filter((l) => l.properties.id !== "Bing")
.map((l) => l.properties)
const bing = keptGlobalLayers.find((l) => l.properties.id === "Bing")
if (bing) {
@ -126,9 +123,10 @@ class DownloadEli extends Script {
}
fs.writeFileSync(target, contents, { encoding: "utf8" })
console.log("Written", keptLayers.length + ", entries to the ELI")
fs.writeFileSync(targetGlobal, JSON.stringify(contentsGlobal,null, " "), { encoding: "utf8" })
fs.writeFileSync(targetGlobal, JSON.stringify(contentsGlobal, null, " "), {
encoding: "utf8",
})
console.log("Written", keptGlobalLayers.length + ", entries to the global ELI")
}
}