0.0.2 • Published 11 years ago

openstreetmapmongo v0.0.2

Weekly downloads
6
License
-
Repository
github
Last release
11 years ago

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);
});

Links

Node and npm modules

Openstreetmap