osm-flatten-relation
Resolve an OpenStreetMap relation recursively.
Last updated 2 years ago by derhuerst .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install osm-flatten-relation 
SYNC missed versions from official npm registry.

osm-flatten-relation

Resolve an OpenStreetMap relation recursively.

npm version build status ISC-licensed chat on gitter support me on Patreon

Installing

npm install osm-flatten-relation

Usage

From the command line:

osm-flatten-relation 2679163 >nodes.ndjson

As a JavaScript library:

flatten(relation, concurrency = 4, retries = 3)

flatten returns a readable stream of a relation's ways and nodes. It will also emit the events relation, way and node whenever it fetched data.

Note: With concurrency > 1, nodes will not be emitted in breadth-first order anymore.

Example

To get all nodes of U-Bahnlinie U6: Alt-Mariendorf => Alt-Tegel with a concurrency of 5 requests:

const flatten = require('osm-flatten-relation')

flatten(2679163, 5)
.on('data', console.log)
{id: 3043920508, latitude: 52.439691,  longitude: 13.3877031}
{id: 31034998,   latitude: 52.4537104, longitude: 13.3843233}
// …
{id: 1688279730, latitude: 52.439011,  longitude: 13.3878563}

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

7 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |