Skip to content

Instantly share code, notes, and snippets.

@tmcw
Created July 16, 2016 18:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmcw/3d521e869976f4c53f72d83726d2b4f8 to your computer and use it in GitHub Desktop.
Save tmcw/3d521e869976f4c53f72d83726d2b4f8 to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
var meta = require('@turf/meta');
var fs = require('fs');
var gj = JSON.parse(fs.readFileSync(process.argv[2], 'utf8'));
meta.coordEach(gj, function(coord) {
if (coord.length === 3) coord.pop();
});
console.log(JSON.stringify(gj));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment