From ca34e535e3b3f52336a2e4b4d48b1defed00fcd1 Mon Sep 17 00:00:00 2001 From: Julian Rojas Date: Wed, 23 Nov 2022 16:23:53 +0100 Subject: [PATCH 1/3] Fix file extension bug --- lib/gtfs2connections.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gtfs2connections.js b/lib/gtfs2connections.js index d225872..fb67b3c 100644 --- a/lib/gtfs2connections.js +++ b/lib/gtfs2connections.js @@ -78,6 +78,7 @@ Mapper.prototype.resultStream = async function (path, output, done) { // Step 5: Merge all the created files into one const format = this._options.format; let ext = null; + let gz = ''; let mergeCommand = 'zcat'; if (!format || ['json', 'mongo', 'jsonld', 'mongold'].indexOf(format) >= 0) { @@ -96,11 +97,11 @@ Mapper.prototype.resultStream = async function (path, output, done) { console.error('Merging final Linked Connections file...'); if(this._options.compressed) { mergeCommand = 'cat'; - ext += '.gz'; + gz = '.gz'; } // Join all resulting files into one - await exec(`for i in ${raws.map(r => { return `${r}.${ext}.gz` }).join(" ")} ; do ${mergeCommand} "$i" >> linkedConnections.${ext} && rm "$i" || break ; done`, { cwd: output }); + await exec(`for i in ${raws.map(r => { return `${r}.${ext}.gz` }).join(" ")} ; do ${mergeCommand} "$i" >> linkedConnections.${ext}${gz} && rm "$i" || break ; done`, { cwd: output }); let t1 = new Date(); console.error('linkedConnections.' + ext + ' File created in ' + (t1.getTime() - t0.getTime()) + ' ms'); await del( From 897e4f2cf5343f72333c48f1d247049ff8880c2e Mon Sep 17 00:00:00 2001 From: Julian Rojas Date: Wed, 23 Nov 2022 16:24:03 +0100 Subject: [PATCH 2/3] 2.1.9 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 668c760..766a8ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gtfs2lc", - "version": "2.1.8", + "version": "2.1.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gtfs2lc", - "version": "2.1.8", + "version": "2.1.9", "license": "MIT", "dependencies": { "commander": "^4.1.1", diff --git a/package.json b/package.json index b1bfd56..3491146 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gtfs2lc", - "version": "2.1.8", + "version": "2.1.9", "description": "Mapping script from gtfs to (linked) connections", "main": "lib/gtfs2lc.js", "bin": { From a90af62abd41884cd4ad2c37d917196bb5270be0 Mon Sep 17 00:00:00 2001 From: Julian Rojas Date: Wed, 23 Nov 2022 16:41:19 +0100 Subject: [PATCH 3/3] Update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0f766c3..03b3e50 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ We support other formats such as `csv` as well. For _big_ GTFS files, your memory may not be sufficient. Luckily, we’ve implemented a way to use your hard disk instead of your RAM. You can enable this with an option: `gtfs2lc /path/to/extracted/gtfs -f json --store LevelStore`. +It may also be the case that your disk has limited storage space. In that case you may want to use the `--compressed` option. + ### Step 5: Generate *Linked* Connections! When you download a new GTFS file, all identifiers in there might change and conflict with your previous export. Therefore, we need to think about a way to create global identifiers for the connections, trips, routes and stops in our system. As we are publishing our data on the Web, we will also use Web addresses for these global identifiers.