https://github.com/simonepri/osm-countries
🔎 Get the OpenStreetMap's relation id from a country code.
https://github.com/simonepri/osm-countries
countries maps openstreetmap
Last synced: about 1 year ago
JSON representation
🔎 Get the OpenStreetMap's relation id from a country code.
- Host: GitHub
- URL: https://github.com/simonepri/osm-countries
- Owner: simonepri
- License: mit
- Created: 2017-11-15T22:11:05.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-08T13:44:15.000Z (over 8 years ago)
- Last Synced: 2025-04-12T23:43:50.082Z (about 1 year ago)
- Topics: countries, maps, openstreetmap
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
README
# osm-countries
[](https://travis-ci.org/simonepri/osm-countries) [](https://codecov.io/gh/simonepri/osm-countries) [](https://www.npmjs.com/package/osm-countries) [](https://www.npmjs.com/package/osm-countries) [](https://david-dm.org/simonepri/osm-countries) [](https://david-dm.org/simonepri/osm-countries#info=devDependencies)
> 🔎 Get the OpenStreetMap relation id from a country code.
## Install
```
$ npm install --save osm-countries
```
## Usage
```js
const osmCountries = require('osm-countries');
osmCountries.get('ITA');
// => '365331'
osmCountries.get('USA');
// => '148838'
```
## API
## get(code) ⇒ string
Converts an alpha-3 iso 3166-1 code to its corrispective relation id on OSM.
**Returns**: string - OSM relation id of the given country.
| Param | Type | Description |
| --- | --- | --- |
| code | string | Alpha-3 iso 3166-1 country code. |
## map() ⇒ object
Returns a map from alpha-3 iso 3166-1 codes to theyr corrispective relation
ids on OSM.
**Returns**: object - Map of all OSM relation ids.
## Authors
* **Simone Primarosa** - [simonepri](https://github.com/simonepri)
See also the list of [contributors](https://github.com/simonepri/osm-countries/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.