1

回购:https ://github.com/planarnetwork/raptor

我正在尝试在查询后运行 Depart。任何 GTFS 的输出就足够了。这样给出的查询给出了与异步函数相关的错误。我已将查询修改为:

 var fs = require("fs")
const {loadGTFS, JourneyFactory, RaptorAlgorithmFactory, DepartAfterQuery} = require("raptor-journey-planner");
async function run(){
    var stream = fs.createReadStream('C:/Users/Admin/raptor/gtfs.zip')
const [trips, transfers, interchange, calendars] = await loadGTFS(stream);
const raptor = RaptorAlgorithmFactory.create(trips, transfers, interchange, calendars);
const resultsFactory = new JourneyFactory();
const query = new DepartAfterQuery(raptor, resultsFactory);
const journeys = query.plan('590', '593', new Date(), 9 * 60 * 60);}
run().catch(e => console.error(e));

590 和 593 是我设置的站点。但这也行不通

任何帮助都感激不尽。

4

0 回答 0