locationstar / osmo Goto Github PK
View Code? Open in Web Editor NEWThis project forked from akidee/osmo
Populate a MongoDB collection with OpenStreetMap data
This project forked from akidee/osmo
Populate a MongoDB collection with OpenStreetMap data
osmo: Populate a MongoDB collection with OpenStreetMap data Features - osmo populates a MongoDB database collection with all nodes, ways and relations - Currently, only OSM XML (.osm) is supported - It's just slightly slower than Osmosis (with Postgres) - Prerequisites: see DEPENDENCY - Building: make (A priority is it to make this work in both Mac OS and Linux!) - Synopsis: bin/osmo DATAFILE DATABASE.COLLECTION - To add an index on the primary key: mongo DATABASE --eval \ "printjson(db.COLLECTION.ensureIndex({ p: 1, id: 1 }, { unique: true, dropDups: true, background: true }))" Data model The data model supported by osmo is focussed on minimal data size and unification. Some principles: - nodes, ways and relations are transformed to GeoObject instances to unify the concept and to simplify queries on only 1 collection - Every geoObject has a key named "p" (prefix). It can have the values, "n" (node), "w" (way) or "r" (relation). - keys for regular fields (user, timestamp, ...) are abbreviated to save space - The geoObject primary key is [ 'p', 'id' ] - Example for a GeoObject instance: { "_id" : ObjectId("4e3213dbe9b522a655e3f5ff"), "c" : 4977984, "id" : 318214, "p" : "r", "parts" : { "list" : [ { "p" : "n", "id" : 319621296 }, { "p" : "n", "id" : 560090559 }, { "p" : "n", "id" : 292635574 }, { "p" : "n", "id" : 292635576 }, { "p" : "n", "id" : 245431191 }, { "p" : "w", "id" : 48289915 }, { "p" : "w", "id" : 49366289 }, ... ], "info" : [ { "role" : "forward" }, { "role" : "forward" }, { "role" : "" }, { "role" : "forward" }, { "role" : "" }, { "role" : "forward" }, { "role" : "forward" }, ... ] }, "t" : 1276427410, "tags" : { "network" : "VRT", "operator" : "SWT", "ref" : "4", "route" : "bus", "type" : "route" }, "u" : { "id" : 109925, "name" : "WanMil" }, "v" : 6 } - "parts" is an ObjectView object that has always two properties: "list" (a list of GeoObject references) and "info" (that optionally holds information about the referenced objects in the same order). GeoObjects with p=n do not have parts, with p=w, parts are always references to nodes, with p=r parts can reference any type (node, way, relation). Contribute Take a look at TODO to see a list of priorized features that are still lacking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.