diff --git a/Logic/Osm/OsmObject.ts b/Logic/Osm/OsmObject.ts
index 8a97e9ba1c..224e4ff37b 100644
--- a/Logic/Osm/OsmObject.ts
+++ b/Logic/Osm/OsmObject.ts
@@ -115,6 +115,7 @@ export abstract class OsmObject {
const rels = data.elements.map(wayInfo => {
const rel = new OsmRelation(wayInfo.id)
rel.LoadData(wayInfo)
+ rel.SaveExtraData(wayInfo)
return rel
})
relsSrc.setData(rels)
@@ -496,10 +497,13 @@ export class OsmRelation extends OsmObject {
}
let tags = this.TagsXML();
- return ' \n' +
- members +
- tags +
- ' \n';
+ let cs = ""
+ if(changesetId !== undefined){
+ cs = `changeset="${changesetId}"`
+ }
+ return `
+${members}${tags}
+`;
}
diff --git a/scripts/CycleHighwayFix.ts b/scripts/CycleHighwayFix.ts
index e69de29bb2..5ce8b46d9f 100644
--- a/scripts/CycleHighwayFix.ts
+++ b/scripts/CycleHighwayFix.ts
@@ -0,0 +1,21 @@
+import ScriptUtils from "./ScriptUtils";
+ScriptUtils.fixUtils()
+import {appendFileSync, readFileSync, writeFileSync} from "fs";
+import {OsmObject} from "../Logic/Osm/OsmObject";
+
+ScriptUtils.erasableLog("Fixing the cycle highways...")
+writeFileSync("cycleHighwayFix.osc","\n" +
+ " ", "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).addCallbackAndRunD(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")
+ return true;
+}))
\ No newline at end of file