JSPM

osm-p2p-defork

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 265
  • Score
    100M100P100Q75198F
  • License ISC

convert forking osm-p2p documents into a linear history

Package Exports

  • osm-p2p-defork

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (osm-p2p-defork) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

osm-p2p-defork

Convert forking osm-p2p documents into a linear history.

Transforms a list of osm-p2p-db documents into a sublist with a linear (non-forking) history.

Usage

var defork = require('osm-p2p-defork')

osm.query([[-90, 90], [-180, 180]], function (err, docs) {
  docs = defork(docs)
  console.log(docs)
})

outputs the results from the osm.query(), but with a linear history (no forked documents).

API

var defork = require('osm-p2p-defork')

defork(docs)

Consumes a list of OSM documents, formatted as would be returned by osm-p2p-db's query function.

Returns the same documents, but with certain documents filtered to present a linear history.

Timestamps (a timestamp field) should be present on all documents. If they aren't, sorting happens based on the document's version field. This guarantees a non-forking history, but it will not likely be semantically what you want.

Install

With npm installed, run

$ npm install osm-p2p-defork

License

ISC