From 926ea0b6e46f9966d1b1b9a4157c6ca6708b82fa Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 17 Dec 2024 04:13:05 +0100 Subject: [PATCH] Fix: remove 'id' attribute --- src/Logic/Web/LinkedDataLoader.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Logic/Web/LinkedDataLoader.ts b/src/Logic/Web/LinkedDataLoader.ts index 21a8ab650..16b3b0ee3 100644 --- a/src/Logic/Web/LinkedDataLoader.ts +++ b/src/Logic/Web/LinkedDataLoader.ts @@ -421,6 +421,7 @@ export default class LinkedDataLoader { delete output["chargeEnd"] delete output["chargeStart"] delete output["timeUnit"] + delete output["id"] asBoolean("covered") asBoolean("fee", true) @@ -800,14 +801,19 @@ export default class LinkedDataLoader { for (const unpatchedKey in unpatched) { // Dirty hack const rawData = await Utils.downloadJsonCached(url, 1000*60*60) - const images = rawData["photos"].map(ph => ph.image) - unpatched[unpatchedKey].images = new Set(images) + const images = rawData["photos"]?.map(ph => ph.image) + if(images){ + unpatched[unpatchedKey].images = new Set(images) + } } console.log("Got unpatched:", unpatched) const patched: Feature[] = [] - for (const section in unpatched) { + for (let section in unpatched) { const p = LinkedDataLoader.patchVeloparkProperties(unpatched[section]) + if(Object.keys(unpatched).length === 1 && section.endsWith("#section1")){ + section = section.split("#")[0] + } p["ref:velopark"] = [section] patched.push(LinkedDataLoader.asGeojson(p)) }