diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-18 16:08:20 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-18 16:08:20 +1000 |
commit | b1da93a369ebcaecee3a2a5b10ccaf556e1cf119 (patch) | |
tree | afefd8abeaa624c57e07e071ee4d7da5a11d5aa9 /bin/vicmap2osm.js | |
parent | c0d189a1c8c0f3417d0f4853dc2c6a1447e6ee74 (diff) |
log process in vicmap2osm
Diffstat (limited to 'bin/vicmap2osm.js')
-rwxr-xr-x | bin/vicmap2osm.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/vicmap2osm.js b/bin/vicmap2osm.js index 695a08c..bac3144 100755 --- a/bin/vicmap2osm.js +++ b/bin/vicmap2osm.js @@ -35,10 +35,17 @@ if (!fs.existsSync(inputFile)) { process.exit(1) } +let sourceCount = 0 const transform = new Transform({ readableObjectMode: true, writableObjectMode: true, transform(feature, encoding, callback) { + if (!argv.quiet) { + if (process.stdout.isTTY && sourceCount % 10000 === 0) { + process.stdout.write(` ${sourceCount / 1000}k\r`) + } + } + // convert source Feature into a Feature per the OSM schema const osm = toOSM(feature, { tracing: argv.tracing |