Skip to content

Instantly share code, notes, and snippets.

@zhm
Created December 1, 2011 07:25
Show Gist options
  • Save zhm/1414632 to your computer and use it in GitHub Desktop.
Save zhm/1414632 to your computer and use it in GitHub Desktop.
merge GeoJSON quick&dirty
var fs = require('fs');
var files = process.argv.slice(2);
var output = { type: 'LineString', coordinates: [ ] };
for (var i = 0; i < files.length; ++i) {
output.coordinates.append(JSON.parse(fs.readFileSync(files[i])).coordinates);
}
fs.writeFileSync('output.json', JSON.stringify(output, null, '\t'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment