From b1da93a369ebcaecee3a2a5b10ccaf556e1cf119 Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Tue, 18 May 2021 16:08:20 +1000 Subject: log process in vicmap2osm --- bin/vicmap2osm.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'bin/vicmap2osm.js') 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 -- cgit v1.2.3