Get US state name by coordinates
Forked from which-country
Powered by rbush and modified Natural Earth 50m countries dataset.
If you are interested in more general solution, try which-polygon.
npm install which-state
and then:
var wc = require('which-state');
// pass [lng, lat]
console.log(wc([-107, 40])); // Colorado
console.log(wc([40, -40])); // null, somewhere in Atlantic Ocean
Run tests:
npm test
Generate R-tree:
npm run generate
MIT