Skip to content

Get ISO 3166-1 alpha-3 country code for geographic coordinates

Notifications You must be signed in to change notification settings

farruxx/which-state

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

which-state

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.

Usage

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

Development

Run tests:

npm test

Generate R-tree:

npm run generate

License

MIT

About

Get ISO 3166-1 alpha-3 country code for geographic coordinates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 93.0%
  • HTML 6.0%
  • CSS 1.0%