Gathering detailed insights and metrics for osm-p2p-db-importer
Gathering detailed insights and metrics for osm-p2p-db-importer
Gathering detailed insights and metrics for osm-p2p-db-importer
Gathering detailed insights and metrics for osm-p2p-db-importer
npm install osm-p2p-db-importer
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
4 Stars
53 Commits
1 Forks
2 Watchers
2 Branches
2 Contributors
Updated on May 26, 2024
Latest Version
2.0.4
Package Id
osm-p2p-db-importer@2.0.4
Size
284.81 kB
NPM Version
3.10.10
Node Version
6.9.5
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Fast imports from OSM XML into a fresh osm-p2p-db
This is useful if you have a very large OSM dataset that would otherwise be too
slow to insert directly into osm-p2p-db
.
smaller.xml
: 1.4mb
6.xml
: 18mb
A fresh import is a special case that lets us make a key assumption:
There is a lot of cost in ensuring consistency across the layers of
osm-p2p-*
, which can be potentially skipped if we know we don't need to worry
about inconsistent data coming in.
This module skips multiple layers, accepting OSM XML data and generating LevelDB
batch operations directly, without the osm-p2p-db
, hyperkv
, and hyperlog
layers of processing in between. This isn't very stable in the long-term (since
the things under the blankets of these modules may change), but for now it makes
for some very quick data insertions into a fresh DB.
1var importer = require('osm-p2p-db-importer') 2var fs = require('fs') 3 4var xml = fs.createReadStream('./hawaii.xml') 5 6var dbPath = '/tmp/osm-p2p-ex' 7 8importer(dbPath, xml, function (err) { 9 console.log(err ? err : 'import done!') 10 11 // OPTIONAL: wait for indexes to be generated 12 var osmdb = require('osm-p2p') 13 var osm = osmdb(dbPath) 14 osm.ready(function () { 15 console.log('indexes generated') 16 }) 17})
outputs
done!
1var importer = require('osm-p2p-db-importer')
osmDir
: path to a directory where the osm-p2p-db
will be located.xmlStream
: a readable stream of OSM XML data.opts
: options object. Currently accepts slow: true|false
.done
: a callback function, receiving an error err
or null
.Like the above, except operating on a user-specified LevelUP instance, db
.
This is useful if you aren't using a filesystem-backed LevelDOWN as your
back-end.
USAGE: osm-p2p-db-importer [--slow] DBDIR [XMLFILE]
Import OSM XML into an osm-p2p-db located at DBDIR. XMLFILE is a file
containing OSM XML. If not specified, OSM XML is read from standard input.
--slow, -s: skip fragile optimizations; import using the normal osm-p2p-db
process.
Anything that would be an acceptable upload to OSM v0.6's POST /api/0.6/changeset/:id/upload
should work here.
Note that this module doesn't create a changeset for you. You will need to create one first, an ensure your XML has that changeset set.
With npm installed, run
$ npm install osm-p2p-db-importer
$ npm install --global osm-p2p-db-importer
ISC
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More