Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 months 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-08T13:44:15.000Z (about 7 years ago)
- Last Synced: 2024-10-15T15:04:11.832Z (3 months ago)
- Topics: countries, maps, openstreetmap
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 11
- Watchers: 4
- 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
[![Travis CI](https://travis-ci.org/simonepri/osm-countries.svg?branch=master)](https://travis-ci.org/simonepri/osm-countries) [![Codecov](https://img.shields.io/codecov/c/github/simonepri/osm-countries/master.svg)](https://codecov.io/gh/simonepri/osm-countries) [![npm](https://img.shields.io/npm/dm/osm-countries.svg)](https://www.npmjs.com/package/osm-countries) [![npm version](https://img.shields.io/npm/v/osm-countries.svg)](https://www.npmjs.com/package/osm-countries) [![npm dependencies](https://david-dm.org/simonepri/osm-countries.svg)](https://david-dm.org/simonepri/osm-countries) [![npm dev dependencies](https://david-dm.org/simonepri/osm-countries/dev-status.svg)](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.