akidee/osmo
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
master
Could not load branches
Nothing to show
Could not load tags
Nothing to show
{{ refName }}
default
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code
-
Clone
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
- Open with GitHub Desktop
- Download ZIP
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
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.
About
Populate a MongoDB collection with OpenStreetMap data
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published