summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/gendata.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/tools/gendata.js b/tools/gendata.js
index 0a1f5b4..c671cf6 100644
--- a/tools/gendata.js
+++ b/tools/gendata.js
@@ -307,15 +307,20 @@ locales.forEach(loc => {
loc.adjacent = []
loc.adjacent_by_trackway = []
loc.adjacent_by_waterway = []
- for (let [to, way] of loc.ways) {
- if (!loc.adjacent.includes(to))
- loc.adjacent.push(to)
- if (ways[way].type === "trackway")
- if (!loc.adjacent_by_trackway.includes(to))
- loc.adjacent_by_trackway.push(to)
- if (ways[way].type === "waterway")
- if (!loc.adjacent_by_waterway.includes(to))
- loc.adjacent_by_waterway.push(to)
+ for (let data of loc.ways) {
+ let to = data[0]
+ for (let i = 1; i < data.length; ++i) {
+ let way = data[i]
+ console.log("WAY", loc.name, to, way)
+ if (!loc.adjacent.includes(to))
+ loc.adjacent.push(to)
+ if (ways[way].type === "trackway")
+ if (!loc.adjacent_by_trackway.includes(to))
+ loc.adjacent_by_trackway.push(to)
+ if (ways[way].type === "waterway")
+ if (!loc.adjacent_by_waterway.includes(to))
+ loc.adjacent_by_waterway.push(to)
+ }
}
loc.adjacent.sort(cmpnum)
loc.adjacent_by_trackway.sort(cmpnum)