Skip to content

Instantly share code, notes, and snippets.

@olafveerman
Last active August 2, 2016 18:25
Show Gist options
  • Save olafveerman/1496a45735f9a79ff2d76584e1cc7621 to your computer and use it in GitHub Desktop.
Save olafveerman/1496a45735f9a79ff2d76584e1cc7621 to your computer and use it in GitHub Desktop.
countries.json = a geojson with data from Natural Earth
'use strict';
const turf = require('turf');
const countries = require('./countries.json')
let bboxs = countries.features.map(function(feature) {
if (feature.properties.ISO_A2 !== '-99') {
return {
iso: feature.properties.ISO_A2,
name: feature.properties.ADMIN,
bbox: turf.bbox(feature)
}
}
})
console.log(bboxs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment