forked from MapComplete/MapComplete
Merge develop
This commit is contained in:
commit
24e7bc95cb
354 changed files with 1394 additions and 86984 deletions
|
@ -91,6 +91,14 @@ export class Conflate extends Script {
|
|||
const unmatched = external_features.filter(
|
||||
(f) => !bestMatches.some((matched) => matched.match.external_feature === f)
|
||||
)
|
||||
const weirdMatch = external_features.filter((f) =>
|
||||
bestMatches.some(
|
||||
(matched) =>
|
||||
matched.match.external_feature === f &&
|
||||
!matched.replayed.certainly_imported &&
|
||||
!matched.replayed.possibly_imported
|
||||
)
|
||||
)
|
||||
const match_lengths: (string | number)[][] = [
|
||||
[
|
||||
"osm_id",
|
||||
|
@ -111,6 +119,9 @@ export class Conflate extends Script {
|
|||
if (Object.keys(resting_properties).length === 0) {
|
||||
continue
|
||||
}
|
||||
if (!certainly_imported && !possibly_imported) {
|
||||
continue
|
||||
}
|
||||
const id = osm_feature.properties["@id"]
|
||||
match_lengths.push([
|
||||
id,
|
||||
|
@ -153,6 +164,19 @@ export class Conflate extends Script {
|
|||
" "
|
||||
)
|
||||
)
|
||||
|
||||
fs.writeFileSync(
|
||||
targetDir + "/unmatched_but_has_close_feature.geojson",
|
||||
JSON.stringify(
|
||||
{
|
||||
type: "FeatureCollection",
|
||||
features: weirdMatch,
|
||||
},
|
||||
|
||||
null,
|
||||
" "
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private async findTimeFork(
|
||||
|
@ -292,12 +316,12 @@ export class Conflate extends Script {
|
|||
}
|
||||
if (properties["website"]) {
|
||||
let website = properties.website.toLowerCase()
|
||||
website
|
||||
website = website
|
||||
.replace("http://http://", "http://")
|
||||
.replace("https://https://", "https://")
|
||||
.replace("https//", "https://")
|
||||
.replace("http://", "https://")
|
||||
if (website.startsWith("https://")) {
|
||||
if (!website.startsWith("https://")) {
|
||||
website = "https://" + website
|
||||
}
|
||||
const validator = new UrlValidator()
|
||||
|
|
|
@ -36,6 +36,9 @@ function WriteFile(
|
|||
noTableOfContents: boolean
|
||||
}
|
||||
): void {
|
||||
if (!html) {
|
||||
return
|
||||
}
|
||||
for (const source of autogenSource) {
|
||||
if (source.indexOf("*") > 0) {
|
||||
continue
|
||||
|
@ -109,6 +112,7 @@ function GenLayerOverviewText(): BaseUIElement {
|
|||
for (const id of Constants.priviliged_layers) {
|
||||
if (!AllSharedLayers.sharedLayers.has(id)) {
|
||||
console.error("Priviliged layer definition not found: " + id)
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,14 @@ class LayerOverviewUtils extends Script {
|
|||
sourcefile = [sourcefile]
|
||||
}
|
||||
|
||||
return sourcefile.some((sourcefile) => statSync(sourcefile).mtime > targetModified)
|
||||
for (const path of sourcefile) {
|
||||
const hasChange = statSync(path).mtime > targetModified
|
||||
if (hasChange) {
|
||||
console.log("File ", targetfile, " should be updated as ", path, "has been changed")
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
writeSmallOverview(
|
||||
|
@ -180,7 +187,7 @@ class LayerOverviewUtils extends Script {
|
|||
if (key === "id") {
|
||||
return
|
||||
}
|
||||
value.id = value.id ?? key
|
||||
value["id"] = value["id"] ?? key
|
||||
})
|
||||
|
||||
return dict
|
||||
|
@ -434,30 +441,27 @@ class LayerOverviewUtils extends Script {
|
|||
const themeInfo = themeFiles[i]
|
||||
const themePath = themeInfo.path
|
||||
let themeFile = themeInfo.parsed
|
||||
console.log(`Validating ${i}/${themeFiles.length} '${themeInfo.parsed.id}'`)
|
||||
{
|
||||
const targetPath =
|
||||
LayerOverviewUtils.themePath +
|
||||
"/" +
|
||||
themePath.substring(themePath.lastIndexOf("/"))
|
||||
const usedLayers = Array.from(
|
||||
LayerOverviewUtils.extractLayerIdsFrom(themeFile, false)
|
||||
).map((id) => LayerOverviewUtils.layerPath + id + ".json")
|
||||
if (!forceReload && !this.shouldBeUpdated([themePath, ...usedLayers], targetPath)) {
|
||||
fixed.set(
|
||||
themeFile.id,
|
||||
JSON.parse(
|
||||
readFileSync(
|
||||
LayerOverviewUtils.themePath + themeFile.id + ".json",
|
||||
"utf8"
|
||||
)
|
||||
)
|
||||
|
||||
const targetPath =
|
||||
LayerOverviewUtils.themePath + "/" + themePath.substring(themePath.lastIndexOf("/"))
|
||||
const usedLayers = Array.from(
|
||||
LayerOverviewUtils.extractLayerIdsFrom(themeFile, false)
|
||||
).map((id) => LayerOverviewUtils.layerPath + id + ".json")
|
||||
|
||||
if (!forceReload && !this.shouldBeUpdated([themePath, ...usedLayers], targetPath)) {
|
||||
fixed.set(
|
||||
themeFile.id,
|
||||
JSON.parse(
|
||||
readFileSync(LayerOverviewUtils.themePath + themeFile.id + ".json", "utf8")
|
||||
)
|
||||
skippedThemes.push(themeFile.id)
|
||||
continue
|
||||
}
|
||||
recompiledThemes.push(themeFile.id)
|
||||
)
|
||||
console.log("Skipping", themeFile.id)
|
||||
skippedThemes.push(themeFile.id)
|
||||
continue
|
||||
}
|
||||
console.log(`Validating ${i}/${themeFiles.length} '${themeInfo.parsed.id}'`)
|
||||
|
||||
recompiledThemes.push(themeFile.id)
|
||||
|
||||
new PrevalidateTheme().convertStrict(themeFile, themePath)
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue