Fix: remove 'id' attribute

This commit is contained in:
Pieter Vander Vennet 2024-12-17 04:13:05 +01:00
parent 74618c2282
commit 926ea0b6e4

View file

@ -421,6 +421,7 @@ export default class LinkedDataLoader {
delete output["chargeEnd"] delete output["chargeEnd"]
delete output["chargeStart"] delete output["chargeStart"]
delete output["timeUnit"] delete output["timeUnit"]
delete output["id"]
asBoolean("covered") asBoolean("covered")
asBoolean("fee", true) asBoolean("fee", true)
@ -800,14 +801,19 @@ export default class LinkedDataLoader {
for (const unpatchedKey in unpatched) { for (const unpatchedKey in unpatched) {
// Dirty hack // Dirty hack
const rawData = await Utils.downloadJsonCached<object>(url, 1000*60*60) const rawData = await Utils.downloadJsonCached<object>(url, 1000*60*60)
const images = rawData["photos"].map(ph => <string> ph.image) const images = rawData["photos"]?.map(ph => <string> ph.image)
unpatched[unpatchedKey].images = new Set<string>(images) if(images){
unpatched[unpatchedKey].images = new Set<string>(images)
}
} }
console.log("Got unpatched:", unpatched) console.log("Got unpatched:", unpatched)
const patched: Feature[] = [] const patched: Feature[] = []
for (const section in unpatched) { for (let section in unpatched) {
const p = LinkedDataLoader.patchVeloparkProperties(unpatched[section]) const p = LinkedDataLoader.patchVeloparkProperties(unpatched[section])
if(Object.keys(unpatched).length === 1 && section.endsWith("#section1")){
section = section.split("#")[0]
}
p["ref:velopark"] = [section] p["ref:velopark"] = [section]
patched.push(LinkedDataLoader.asGeojson(p)) patched.push(LinkedDataLoader.asGeojson(p))
} }