osm-extractor

    1.0.0 • Public • Published

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

    Install

    npm i osm-extractor

    DownloadsWeekly Downloads

    7

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    169 kB

    Total Files

    10

    Last publish

    Collaborators

    • boyur
    • device25
    • karmatsky
    • stepankuzmin