{"id":17497562,"url":"https://github.com/simonepri/country-iso","last_synced_at":"2025-04-09T16:16:13.754Z","repository":{"id":66098935,"uuid":"102361392","full_name":"simonepri/country-iso","owner":"simonepri","description":"🗺 Get the ISO 3166-1 alpha-3 country code from geographic coordinates.","archived":false,"fork":false,"pushed_at":"2018-01-08T13:30:05.000Z","size":12944,"stargazers_count":144,"open_issues_count":2,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T16:15:53.184Z","etag":null,"topics":["country-iso","geojson","maps","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonepri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-04T12:55:38.000Z","updated_at":"2025-02-19T06:14:33.000Z","dependencies_parsed_at":"2023-03-10T23:37:01.505Z","dependency_job_id":null,"html_url":"https://github.com/simonepri/country-iso","commit_stats":{"total_commits":91,"total_committers":2,"mean_commits":45.5,"dds":"0.39560439560439564","last_synced_commit":"4a9cc3fd9c7d1a8864a8f18f157509758d4a7eb8"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fcountry-iso","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fcountry-iso/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fcountry-iso/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonepri%2Fcountry-iso/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonepri","download_url":"https://codeload.github.com/simonepri/country-iso/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065283,"owners_count":21041872,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["country-iso","geojson","maps","nodejs"],"created_at":"2024-10-19T15:58:11.522Z","updated_at":"2025-04-09T16:16:13.720Z","avatar_url":"https://github.com/simonepri.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# country-iso\n[![Travis CI](https://travis-ci.org/simonepri/country-iso.svg?branch=master)](https://travis-ci.org/simonepri/country-iso) [![Codecov](https://img.shields.io/codecov/c/github/simonepri/country-iso/master.svg)](https://codecov.io/gh/simonepri/country-iso) [![npm](https://img.shields.io/npm/dm/country-iso.svg)](https://www.npmjs.com/package/country-iso) [![npm version](https://img.shields.io/npm/v/country-iso.svg)](https://www.npmjs.com/package/country-iso) [![npm dependencies](https://david-dm.org/simonepri/country-iso.svg)](https://david-dm.org/simonepri/country-iso) [![npm dev dependencies](https://david-dm.org/simonepri/country-iso/dev-status.svg)](https://david-dm.org/simonepri/country-iso#info=devDependencies)\n\u003e 🗺 Get ISO 3166-1 alpha-3 country code from geographic coordinates.\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://simonepri.github.io/country-iso/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/simonepri/country-iso/master/demo/index.png\" width=\"400\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003eClick on the map to see a live preview.\u003c/p\u003e\n\n## Synopsis\nGiven the latitude and longitude coordinates this package returns the country code of the country in which the coordinates fall into.\n\nThe package internally uses [@geo-maps/countries-maritime](https://github.com/simonepri/geo-maps/blob/master/info/countries-maritime.md) map with 10m resolution to give you the right country code.\nThe accuracy of the map has been tested with [23785 cities](fixtures/cities.geo.json) but the [demo](http://simonepri.github.io/country-iso/) allows you to actually test it manually by just clicking on the map to see what it returns.\n\nDo you believe that this is useful? If so, \u003ca href=\"#start-of-content\"\u003esupport us with a ⭐️\u003c/a\u003e!\n\n## Install\n```bash\n$ npm install --save country-iso\n```\n\n## Usage\nYou can query any `(lat,lng)` pair on the earth. It also works for territorial waters and disputed countries.\n\n```javascript\nconst countryIso = require('country-iso');\n\n// Query a point in Italy.\ncountryIso.get(41.9028, 12.4964);\n// =\u003e ['ITA']\n\n// Query a disputed country.\ncountryIso.get(24, -14);\n// =\u003e ['ESH', 'MAR']\n\n// Query a point somewhere in Atlantic Ocean.\ncountryIso.get(40, -40);\n// =\u003e []\n```\n\n## API\n## get(lat, lng) ⇒ \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e\nSearches for every country which contains the point (lat, lng).\n\n**Returns**: \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e - Array of ISO 3166 alpha-3 country code for the geographic\n coordinates.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| lat | \u003ccode\u003enumber\u003c/code\u003e | The latitude of the point. |\n| lng | \u003ccode\u003enumber\u003c/code\u003e | The longitude of the point. |\n\n## Related\n* [is-sea](https://github.com/simonepri/is-sea): 🌊 Check whether a geographic coordinate is in the sea or not on the earth.\n\n## Authors\n* **Matteo Chen** - [chq-matteo](https://github.com/chq-matteo)\n* **Simone Primarosa** - [simonepri](https://github.com/simonepri)\n\nSee also the list of [contributors](https://github.com/simonepri/country-iso/contributors) who participated in this project.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fcountry-iso","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonepri%2Fcountry-iso","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonepri%2Fcountry-iso/lists"}