# osm-extractor

> Extracts data from OpenStreetMap

Latest version **1.0.0** (published 2018-09-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install osm-extractor
pnpm add osm-extractor
yarn add osm-extractor
bun add osm-extractor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-09-17 |
| First published | 2018-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 165.4 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Stepan Kuzmin |
| Maintainers | stepankuzmin |
| Keywords | osm, openstreetmap, extracts, nominatim |

## Links

- npm: https://www.npmjs.com/package/osm-extractor
- Repository: https://github.com/stepankuzmin/osm-extractor
- Issues: https://github.com/stepankuzmin/osm-extractor/issues
- npm.io page: https://npm.io/package/osm-extractor

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.18.0

## Recent versions

- 1.0.0 (latest) — 2018-09-17

## README

# osm-extractor

[![Build Status](https://travis-ci.org/urbica/osm-extractor.svg?branch=master)](https://travis-ci.org/urbica/osm-extractor)

Extracts data from [OpenStreetMap](https://www.openstreetmap.org) using [Overpass API](https://overpass-turbo.eu/).

<img align="center" src="https://raw.githubusercontent.com/urbica/osm-extractor/master/Overpass_API.png" />

## Installation

```shell
npm i osm-extractor
```

## Usage

Geocode and extract area using [Overpass API](https://overpass-turbo.eu/)

```js
const fs = require("fs");
const { extractWithGeocode } = require("osm-extractor");

extractWithGeocode("Liechtenstein").then(data =>
  data.pipe(fs.createWriteStream("data.osm"))
);
```

Extract OpenStreetMap data from Overpass using [BBox](https://wiki.openstreetmap.org/wiki/Bounding_Box)

```js
const fs = require("fs");
const { extractWithBBox } = require("osm-extractor");

extractWithBBox([11.5, 48.1, 11.6, 48.2]).then(data =>
  data.pipe(fs.createWriteStream("data.osm"))
);
```

Extract from [Overpass API](https://overpass-turbo.eu/) using [Overpass QL](https://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide)

```js
const fs = require("fs");
const { extractWithQuery } = require("osm-extractor");

const query = "node(50.745,7.17,50.75,7.18);out;";
extractWithQuery(query).then(data =>
  data.pipe(fs.createWriteStream("data.osm"))
);
```

---
_Source: https://npm.io/package/osm-extractor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
