openstreetmapmongo

Store Openstreetmap data in Mongo DB

npm install openstreetmapmongo
4 downloads in the last month

OpenstreetmapMongo

Credits

Description

Store Openstreetmap data in Mongo DB

Usage

var assert = require('assert');
var util = require('util');

var OsmMongo = require('../osm-mongo').OsmMongo;

settings = {
    MONGO_HOST: 'localhost',
    MONGO_PORT: 27017
}

osm = new OsmMongo(settings.MONGO_HOST, settings.MONGO_PORT);

// find a subway lines near Santiago center
osm.findOsmNear([ -70.650404, -33.4379537 ], 16, {railway: "subway"}, function(error, subway) {
    var len = 0;
    subway.ways.forEach(function(way) {
        len += way.getLengthMeters();
    })
    console.log("Total subway length in km "+len/1000.0);
    process.exit(0);
});

Node and npm modules

Openstreetmap

npm loves you