StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
https://doi.org/10.1109/TVCG.2020.3030352
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
41 lines
1.2 KiB
4 years ago
|
#!/usr/bin/env node
|
||
|
|
||
|
var commander = require("commander"),
|
||
|
d3 = Object.assign({}, require("d3-geo"), require("../")),
|
||
|
read = require("./read"),
|
||
|
write = require("./write");
|
||
|
|
||
|
commander
|
||
|
.version(require("../package.json").version)
|
||
|
.usage("[options] [file]")
|
||
|
.description("Quantize GeoJSON.")
|
||
|
.option("-o, --out <file>", "output file name; defaults to “-” for stdout", "-")
|
||
|
.option("-p, --precision <value>", "number of output digits after the decimal point")
|
||
|
.option("-n, --newline-delimited", "use newline-delimited JSON")
|
||
|
.parse(process.argv);
|
||
|
|
||
|
if (commander.args.length > 1) {
|
||
|
console.error();
|
||
|
console.error(" error: multiple input files");
|
||
|
console.error();
|
||
|
process.exit(1);
|
||
|
} else if (commander.args.length === 0) {
|
||
|
commander.args.push("-");
|
||
|
}
|
||
|
|
||
|
var reader = read(commander.args[0], commander.newlineDelimited, quantize).then(end).catch(abort),
|
||
|
writer = write(commander.out);
|
||
|
|
||
|
function quantize(d, i) {
|
||
|
if (commander.precision != null) d = d3.geoQuantize(d, commander.precision);
|
||
|
return writer.write(JSON.stringify(d) + "\n");
|
||
|
}
|
||
|
|
||
|
function end() {
|
||
|
return writer.end();
|
||
|
}
|
||
|
|
||
|
function abort(error) {
|
||
|
console.error(error.stack);
|
||
|
}
|