Skip to content

Instantly share code, notes, and snippets.

View danieledler's full-sized avatar

Daniel Edler danieledler

View GitHub Profile
@danieledler
danieledler / cleanup.js
Last active August 29, 2015 14:20 — forked from mbostock/cleanup.js
var fs = require("fs");
var roundPrecision = 1e6;
fs.readFile("/dev/stdin", "utf-8", function(error, input) {
var collection = JSON.parse(input);
switch (collection.type) {
case "FeatureCollection": return cleanupFeatureCollection(collection);
case "GeometryCollection": return cleanupGeometryCollection(collection);
default: throw "unknown type: " + collection.type;