Reformat all files with prettier

This commit is contained in:
Pieter Vander Vennet 2022-09-08 21:40:48 +02:00
parent e22d189376
commit b541d3eab4
382 changed files with 50893 additions and 35566 deletions

View file

@ -1,21 +1,34 @@
import ScriptUtils from "./ScriptUtils";
import {appendFileSync, readFileSync, writeFileSync} from "fs";
import {OsmObject} from "../Logic/Osm/OsmObject";
import ScriptUtils from "./ScriptUtils"
import { appendFileSync, readFileSync, writeFileSync } from "fs"
import { OsmObject } from "../Logic/Osm/OsmObject"
ScriptUtils.fixUtils()
ScriptUtils.erasableLog("Fixing the cycle highways...")
writeFileSync("cycleHighwayFix.osc", "<osmChange version=\"0.6\" generator=\"Handmade\" copyright=\"OpenStreetMap and Contributors\"\n" +
" attribution=\"http://www.openstreetmap.org/copyright\" license=\"http://opendatacommons.org/licenses/odbl/1-0/\">\n" +
" <modify>", "utf8")
const ids = JSON.parse(readFileSync("export.geojson", "utf-8")).features.map(f => f.properties["@id"])
writeFileSync(
"cycleHighwayFix.osc",
'<osmChange version="0.6" generator="Handmade" copyright="OpenStreetMap and Contributors"\n' +
' attribution="http://www.openstreetmap.org/copyright" license="http://opendatacommons.org/licenses/odbl/1-0/">\n' +
" <modify>",
"utf8"
)
const ids = JSON.parse(readFileSync("export.geojson", "utf-8")).features.map(
(f) => f.properties["@id"]
)
console.log(ids)
ids.map(id => OsmObject.DownloadReferencingRelations(id).then(relations => {
console.log(relations)
const changeparts = relations.filter(relation => relation.tags["cycle_highway"] == "yes" && relation.tags["note:state"] == undefined)
.map(relation => {
relation.tags["note:state"] = "has_highway_under_construction";
return relation.ChangesetXML(undefined)
})
appendFileSync("cycleHighwayFix.osc", changeparts.join("\n"), "utf8")
}))
ids.map((id) =>
OsmObject.DownloadReferencingRelations(id).then((relations) => {
console.log(relations)
const changeparts = relations
.filter(
(relation) =>
relation.tags["cycle_highway"] == "yes" &&
relation.tags["note:state"] == undefined
)
.map((relation) => {
relation.tags["note:state"] = "has_highway_under_construction"
return relation.ChangesetXML(undefined)
})
appendFileSync("cycleHighwayFix.osc", changeparts.join("\n"), "utf8")
})
)