aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 72eb5c8b6fceceaecd191c627cb6e4897c0ee57f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# OpenStreetMaps to Mongo

Simple loader from osm dump file to mongodb. Based on https://github.com/paulmach/osm package.

## Build

`go build -o osm2go`

## Usage

`./osm2go -osmfile=PATH_TO_OSM_FILE`

All flags:

* `-osmfile` (required) OSM file
* `-initial` (default:false) Is initial import (uses insert, not upsert)
* `-indexes` (default:false) Create indexes (needs only first time)
* `-dbconnection` (default:"mongodb://localhost:27017") Mongo database name
* `-dbname` (default:"map") Mongo database name
* `-layers` (default:"nodes,ways,relations") Layers to import
* `-block` (default:1000) Block size to bulk write
* `-concurrency` (default:32) Concurrency read and write

## Example

```
# ./osm2mgo -osmfile ~/Downloads/RU.pbf
Nodes: 1294069 Ways: 0 Relations: 0
```