Parse and push .osm files to Mongodb

package renamed to mongosm
Last updated 7 years ago by sammerry .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install node-mongosm 
SYNC missed versions from official npm registry.


This package will convert .osm files from Open Street Map and save / upsert new entries to your personal instance of mongoDB.


ensure you have mongoDB installed on your system and Install dependencies via npm.

npm install -d


In options.js set the {filename: "your_file.osm"} and run the app. You will also want to set {upsert: true/false} to your needs.

note: if upsert = false, documents which already exist in the database will not be modefied and will not be printed out in verbose mode.

node mongosm

alternatively you can run it from the commandline with

./mongosm -v -f "your-file.osm"

##Command-line Flags

  -v verbose
  -f file path
  -l to lowercase
  -u upcert all entries : defaults to save
  -s suppress errors
  -host host name
  -port port
  -k document filter: removes all attributes except ones supplied in comma separated list EX: -k way:user,timestamp
  -i document filter: includes all attributes except ones supplied in comma separated list EX: -i way:user,timestamp
  -db database
  -h help


Commandline options are generally preferred, but option defaults may be manually set in the options.js file.

Standard Options:

  verbose: false
  filename: "example-osm/way.osm"
  host: "localhost"
  port: "27017"
  database: "test"
  suppressErrors: false
  useOriginalID: false
  upsert: false
  xmlns: true
  strict: false

Document Filter Options:

  ignoreAttributes: []  // items to excluded
  keepAttributes: [] // strict list of items to include

only one document filter type should be needed


  • Time Stamp Bucketing
  • Better handling for relation refs
  • Retry once on insert failure
  • Testing vs sample .osm files
  • Support for multiple files

Current Tags

  • 0.0.5                                ...           latest (7 years ago)

2 Versions

  • 0.0.5 [deprecated]           ...           7 years ago
  • 0.0.1 [deprecated]           ...           7 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
Dependents (1)

Copyright 2014 - 2016 © |