https://github.com/urbica/osm-extractor
Extracts data from OpenStreetMap
https://github.com/urbica/osm-extractor
extracts nominatim openstreetmap osm overpass-api overpass-turbo
Last synced: 3 months ago
JSON representation
Extracts data from OpenStreetMap
- Host: GitHub
- URL: https://github.com/urbica/osm-extractor
- Owner: urbica
- License: mit
- Created: 2018-09-13T11:06:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T02:27:58.000Z (almost 3 years ago)
- Last Synced: 2025-08-23T09:27:18.526Z (5 months ago)
- Topics: extracts, nominatim, openstreetmap, osm, overpass-api, overpass-turbo
- Language: JavaScript
- Size: 815 KB
- Stars: 16
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# osm-extractor
[](https://travis-ci.org/urbica/osm-extractor)
Extracts data from [OpenStreetMap](https://www.openstreetmap.org) using [Overpass API](https://overpass-turbo.eu/).

## 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"))
);
```