2019-05-26 02:17:25 +03:00
|
|
|
# OpenStreetMaps to Mongo
|
|
|
|
|
|
|
|
Simple loader from osm dump file to mongodb. Based on https://github.com/paulmach/osm package.
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
2019-06-03 13:59:49 +03:00
|
|
|
`go build -o osm2mgo`
|
2019-05-26 02:17:25 +03:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2019-06-03 13:59:49 +03:00
|
|
|
`./osm2mgo flags`
|
2019-05-30 14:05:08 +03:00
|
|
|
|
2019-06-03 13:59:49 +03:00
|
|
|
### Flags:
|
2019-05-30 14:05:08 +03:00
|
|
|
|
2019-06-03 13:59:49 +03:00
|
|
|
* `-osmfile string` Path to OSM file (PBF format only) (default "./RU.osm.pbf")
|
|
|
|
* `-dbconnection string` Mongo database name (default "mongodb://localhost:27017")
|
|
|
|
* `-dbname string` Mongo database name (default "map")
|
|
|
|
* `-initial` Is initial import?
|
|
|
|
* `-indexes` Create indexes
|
|
|
|
* `-layers string` Layers to import (default "nodes,ways,relations")
|
|
|
|
* `-concurrency int` Workers count (default 32)
|
|
|
|
* `-block int` Block size to bulk write (default 1000)
|
2019-05-26 02:17:25 +03:00
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```
|
|
|
|
# ./osm2mgo -osmfile ~/Downloads/RU.pbf
|
|
|
|
Nodes: 1294069 Ways: 0 Relations: 0
|
|
|
|
```
|