Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dirty hack to merge geoJSON feature.
// Sample use: node mergeFeatures.js argentina.json buenos_aires.json > argentina_merged.json
var origin1 = require(path.resolve(__dirname, process.argv[2])),
origin2 = require(path.resolve(__dirname, process.argv[3])),
destination = {
"type": "FeatureCollection",
"features": []
};
destination.features = origin1.features.concat(origin2.features);
console.log(
JSON.stringify(destination)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment