Add line 4
This commit is contained in:
parent
3c3f446503
commit
6c252413d5
|
@ -47,11 +47,18 @@ const fetchStopsRefAssociations = () => new Promise((res, rej) =>
|
|||
return;
|
||||
}
|
||||
|
||||
let line = row.routeShortName;
|
||||
|
||||
if (line === '4')
|
||||
{
|
||||
line += row.directionId === '0' ? 'A' : 'B';
|
||||
}
|
||||
|
||||
if (!(row.stopId in stops))
|
||||
{
|
||||
stops[row.stopId] = {
|
||||
name: row.stopName,
|
||||
lines: new Set([row.routeShortName]),
|
||||
lines: new Set([line]),
|
||||
directions: new Set([row.tripHeadsign]),
|
||||
};
|
||||
}
|
||||
|
@ -65,7 +72,7 @@ const fetchStopsRefAssociations = () => new Promise((res, rej) =>
|
|||
“${row.stopName}” and “${stop.name}”. Only the first one will be considered.`);
|
||||
}
|
||||
|
||||
stop.lines.add(row.routeShortName);
|
||||
stop.lines.add(line);
|
||||
stop.directions.add(row.tripHeadsign);
|
||||
}
|
||||
});
|
||||
|
@ -185,7 +192,7 @@ out body qt;
|
|||
{
|
||||
console.warn(`Stop ${stop.id} is missing a “ref” tag
|
||||
Name: ${stop.tags.name}
|
||||
Part of line: ${lineRef} (to ${route.tags.to})
|
||||
Part of line: ${route.tags.name}
|
||||
URI: ${osmViewNode}/${stop.id}
|
||||
`);
|
||||
|
||||
|
@ -194,7 +201,7 @@ URI: ${osmViewNode}/${stop.id}
|
|||
// and trip direction
|
||||
const candidates = Object.entries(associations).filter(
|
||||
([stopRef, {name, lines, directions}]) =>
|
||||
lines.has(lineRef)
|
||||
lines.has(route.tags.ref)
|
||||
).map(([stopRef, {name, lines, directions}]) => ({
|
||||
stopRef,
|
||||
lines,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6,7 +6,7 @@ const fs = require('fs');
|
|||
|
||||
(async () =>
|
||||
{
|
||||
const lines = ['1', '2', '3'];
|
||||
const lines = ['1', '2', '3', '4'];
|
||||
const data = await network.fetch(lines);
|
||||
|
||||
fs.writeFileSync(
|
||||
|
|
Loading…
Reference in New Issue