diff options
author | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-07 22:04:59 +1000 |
---|---|---|
committer | Andrew Harvey <andrew@alantgeo.com.au> | 2021-05-07 22:04:59 +1000 |
commit | bb58cd0921d16268a6a1ff3f9d61a141184dded8 (patch) | |
tree | a86599a537f25ec5563becf27c81f3744b083fd9 /bin/reduceRangeDuplicates.js | |
parent | 767efcfc514c200e87545fef10449fdf90bfa941 (diff) |
fix syntax errors
Diffstat (limited to 'bin/reduceRangeDuplicates.js')
-rwxr-xr-x | bin/reduceRangeDuplicates.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/reduceRangeDuplicates.js b/bin/reduceRangeDuplicates.js index ed85d75..6ccbc2f 100755 --- a/bin/reduceRangeDuplicates.js +++ b/bin/reduceRangeDuplicates.js @@ -15,7 +15,7 @@ const fs = require('fs') const { Transform, pipeline } = require('stream') const ndjson = require('ndjson') -const withinRange = require('./lib/withinRange.js') +const withinRange = require('../lib/withinRange.js') const argv = require('yargs/yargs')(process.argv.slice(2)) .option('debug', { @@ -203,7 +203,8 @@ const reduceNonRange = new Transform({ if (!isRange) { // not a range, ahall be removed removed when this non-range exists within a range, but the range wasn't removed already let dropFeature = false - ranges.forEach(range => { + for (let i = 0; i < ranges.length; i++) { + const range = ranges[i] if (withinRange(feature, range)) { // found within a range, drop feature unless would drop addr:unit information if ('addr:unit' in feature.properties) { @@ -223,7 +224,7 @@ const reduceNonRange = new Transform({ } break } - }) + } if (!dropFeature) { this.push(feature) } |