GeoJSON boundaries for Earth, masterfully formatted and normalized for your consumption.
Total # as of writing this: 40,106
Using one of these methods, the boundaries are accessible on any language or platform. Enjoy!
Mostly US boundaries right now (data availability), but would love to add more around the world. Know of more good sources for boundary data? Send a PR!
id
(String)
type
(String)
name
(String)
area
(Object)
npm install boundaries
listSync()
readSync(path)
list([cb])
listSync
read(path[, cb])
readSync
Simple example of listing boundaries and reading them synchronously.
var boundaries = require('boundaries');
var fs = require('fs');
var files = boundaries.listSync();
files.forEach(function(filePath) {
var boundary = boundaries.readSync(filePath);
// Do something with it!
});
import { listSync, readSync } from 'boundaries'
const files = listSync()
files.forEach((filePath) => {
const boundary = readSync(filePath)
// Do something with it!
})