Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.34 KB

README.md

File metadata and controls

49 lines (34 loc) · 1.34 KB

osm-extractor

Build Status

Extracts data from OpenStreetMap using Overpass API.

Installation

npm i osm-extractor

Usage

Geocode and extract area using Overpass API

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

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 using Overpass QL

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