which-country-ne-10m
Get ISO 3166-1 alpha-3 country code for geographic coordinates
in node.js or browser.
Forked from the original which-country library,
this uses Natural Earth's 10m countries database instead of the 50m one which should provide higher accuracy and support for smaller territories
but at the cost of performance and size.
Powered by rbush and modified
Natural Earth 10m countries dataset.
If you are interested in more general solution, try which-polygon.
Usage
npm install which-country-ne-10m
and then:
var wc = require('which-country-ne-10m');
console.log(wc([37, 55]));
console.log(wc([-100, 40]));
console.log(wc([40, -40]));
#Demo
Demo with leaflet and browserify
Development
Run tests:
npm test
Generate R-tree:
npm run generate
License
MIT