Socket
Socket
Sign inDemoInstall

which-country-ne-10m

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    which-country-ne-10m

Get ISO 3166-1 alpha-3 country code for geographic coordinates based on Natural Earth's 10m database


Version published
Weekly downloads
48
decreased by-58.26%
Maintainers
1
Install size
45.5 MB
Created
Weekly downloads
 

Readme

Source

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');

// pass [lng, lat]
console.log(wc([37, 55])); // RUS
console.log(wc([-100, 40])); // USA
console.log(wc([40, -40])); // null, somewhere in Atlantic Ocean

#Demo

Demo with leaflet and browserify

Development

Run tests:

npm test

Generate R-tree:

npm run generate

License

MIT

FAQs

Last updated on 02 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc