Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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.