forked from MapComplete/MapComplete
Chore: housekeeping
This commit is contained in:
parent
69ab755f29
commit
7acddc7281
8 changed files with 84 additions and 88 deletions
|
@ -199,14 +199,14 @@ class GenerateBuildDbScript extends Script {
|
|||
if (allLayers.size === 0) {
|
||||
throw "No layers found at all"
|
||||
}
|
||||
const notCountedCutoff = 100*1000*1000
|
||||
const notCountedCutoff = 100 * 1000 * 1000
|
||||
const notCounted: string[] = []
|
||||
const allNeededLayers: Map<string, { tags: TagsFilter; foundInTheme: string[] }> = new Map<
|
||||
string,
|
||||
{ tags: TagsFilter; foundInTheme: string[] }
|
||||
>()
|
||||
const tagInfo = new TagInfo()
|
||||
const layerTotals = new Map<string, number>();
|
||||
const layerTotals = new Map<string, number>()
|
||||
for (const key of allLayers.keys()) {
|
||||
const layer = allLayers.get(key)
|
||||
if (!layer.isCounted) {
|
||||
|
@ -214,11 +214,16 @@ class GenerateBuildDbScript extends Script {
|
|||
continue
|
||||
}
|
||||
let total = await tagInfo.getCountEstimateFor(layer.tags)
|
||||
console.log("Keys " + layer.tags.asHumanString() + " might have up to " + total + " items")
|
||||
console.log(
|
||||
"Keys " + layer.tags.asHumanString() + " might have up to " + total + " items"
|
||||
)
|
||||
layerTotals.set(key, total)
|
||||
if (total > notCountedCutoff) {
|
||||
notCounted.push(key)
|
||||
console.log("NOT indexing layer " + key + " as it exceeds the cutoff of", notCountedCutoff)
|
||||
console.log(
|
||||
"NOT indexing layer " + key + " as it exceeds the cutoff of",
|
||||
notCountedCutoff
|
||||
)
|
||||
continue
|
||||
}
|
||||
allNeededLayers.set(key, layer)
|
||||
|
@ -250,7 +255,7 @@ class GenerateBuildDbScript extends Script {
|
|||
)
|
||||
console.log("Layer totals (including non-indexed):")
|
||||
for (const key of layerTotals.keys()) {
|
||||
console.log(key,",\t",layerTotals.get(key), ",\t", allLayers.get(key).isCounted)
|
||||
console.log(key, ",\t", layerTotals.get(key), ",\t", allLayers.get(key).isCounted)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue