Snippets

Piotr Szrajber GeoJSON to CSV

Created by Piotr Szrajber
1
2
3
4
5
6
7
8
function geojson2csv(x) {
    var header = Object.keys(x.features[0].properties);
    return [header].concat(x.features.map(function(feature) {
        return header.map(function(col) {
            return feature.properties[col];
        }).join(",");
    })).join("\n");
}

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.