Skip to content

Commit b4074ee

Browse files
arnesetzerwiktorn
authored andcommitted
chore: Update README.md to avoid confusion about missing .osm.bz2 files
Closes #165 #164
1 parent 3af1629 commit b4074ee

1 file changed

Lines changed: 48 additions & 23 deletions

File tree

README.md

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,21 @@ For convenience, a [`docker-compose.yml` template](./docker-compose.yml) is incl
5858

5959
## Overpass instance covering part of the world
6060

61-
In this example the Overpass instance will be initialized with a planet file for Monaco downloaded from Geofabrik.
62-
Data will be stored in folder`/big/docker/overpass_db/` on the host machine and will not contain metadata as this example uses public Geofabrik extracts that do not contain metadata (such as changeset and user).
61+
As .osm.bz2 files are becoming increasingly rare, it is unfortunately often necessary to convert .osm.pbf files to .osm.bz2 files. This can be done either in a Docker container or on the host machine. Several examples of how to proceed are provided.
62+
63+
Data will be stored in folder `/big/docker/overpass_db/` on the host machine and will not contain metadata as this example uses public Geofabrik extracts that do not contain metadata (such as changeset and user).
6364
Overpass will be available on port 12345 on the host machine.
6465

66+
### .osm.bz2 files are directly provided
67+
68+
In this example the Overpass instance will be initialized with a planet file for Monaco. Since there are currently no download servers with the .osm.bz2 file format available you need to get the file on your own or use a solution below.
69+
70+
6571
```
6672
docker run \
6773
-e OVERPASS_META=yes \
6874
-e OVERPASS_MODE=init \
69-
-e OVERPASS_PLANET_URL=http://download.geofabrik.de/europe/monaco-latest.osm.bz2 \
75+
-e OVERPASS_PLANET_URL=http://YOUR-DOWNLOAD-SOURCE-HERE/monaco-latest.osm.bz2 \
7076
-e OVERPASS_DIFF_URL=http://download.openstreetmap.fr/replication/europe/monaco/minute/ \
7177
-e OVERPASS_RULES_LOAD=10 \
7278
-v /big/docker/overpass_db/:/db \
@@ -75,6 +81,45 @@ docker run \
7581
--name overpass_monaco wiktorn/overpass-api
7682
```
7783

84+
### Convert an .osm.pbf file to an .osm.bz2 file in the Docker container
85+
86+
Because Geofabrik provides only PBF extracts with metadata, `osmium` is used in `OVERPASS_PLANET_PREPROCESS` to convert the `pbf` file to `osm.bz2` that's used by Overpass.
87+
88+
```
89+
docker run \
90+
-e OVERPASS_META=yes \
91+
-e OVERPASS_MODE=init \
92+
-e OVERPASS_PLANET_URL=https://download.geofabrik.de/europe/monaco-latest-internal.osm.pbf \
93+
-e OVERPASS_DIFF_URL=https://download.geofabrik.de/europe/monaco-updates/ \
94+
-e OVERPASS_RULES_LOAD=10 \
95+
-e OVERPASS_COMPRESSION=gz \
96+
-e OVERPASS_UPDATE_SLEEP=3600 \
97+
-e OVERPASS_PLANET_PREPROCESS='mv /db/planet.osm.bz2 /db/planet.osm.pbf && osmium cat -o /db/planet.osm.bz2 /db/planet.osm.pbf && rm /db/planet.osm.pbf' \
98+
-v /big/docker/overpass_db/:/db \
99+
-p 12345:80 \
100+
-i -t \
101+
--name overpass_monaco wiktorn/overpass-api
102+
```
103+
104+
### Convert an .osm.pbf file to an .osm.bz2 file on the host machine
105+
This requires osmium installed on your host machine but may be a little bit faster than the conversion in the Docker container.
106+
```
107+
curl -O https://download.geofabrik.de/europe/monaco-latest.osm.pbf
108+
osmium cat monaco-latest.osm.pbf -o /big/docker/overpass_db/planet.osm.bz2
109+
docker run \
110+
-e OVERPASS_META=yes \
111+
-e OVERPASS_MODE=init \
112+
-e OVERPASS_PLANET_URL=file:///db/planet.osm.bz2 \
113+
-e OVERPASS_DIFF_URL=https://download.geofabrik.de/europe/monaco-updates/ \
114+
-e OVERPASS_RULES_LOAD=10 \
115+
-e OVERPASS_COMPRESSION=gz \
116+
-e OVERPASS_UPDATE_SLEEP=3600 \
117+
-v /big/docker/overpass_db/:/db \
118+
-p 12347:80 \
119+
-i -t \
120+
--name overpass_monaco wiktorn/overpass-api
121+
```
122+
78123
## Overpass clone covering whole world
79124

80125
In this example Overpass instance will be initialized with data from main Overpass instance and updated with master planet diffs.
@@ -108,26 +153,6 @@ Prepare file with your credentials `/home/osm/oauth-settings.json`:
108153
}
109154
```
110155

111-
Because Geofabrik provides only PBF extracts with metadata, `osmium` is used in `OVERPASS_PLANET_PREPROCESS` to convert the `pbf` file to `osm.bz2` that's used by Overpass.
112-
113-
```
114-
docker run \
115-
-e OVERPASS_META=yes \
116-
-e OVERPASS_MODE=init \
117-
-e OVERPASS_PLANET_URL=https://osm-internal.download.geofabrik.de/europe/monaco-latest-internal.osm.pbf \
118-
-e OVERPASS_DIFF_URL=https://osm-internal.download.geofabrik.de/europe/monaco-updates/ \
119-
-e OVERPASS_RULES_LOAD=10 \
120-
-e OVERPASS_COMPRESSION=gz \
121-
-e OVERPASS_UPDATE_SLEEP=3600 \
122-
-e OVERPASS_PLANET_PREPROCESS='mv /db/planet.osm.bz2 /db/planet.osm.pbf && osmium cat -o /db/planet.osm.bz2 /db/planet.osm.pbf && rm /db/planet.osm.pbf' \
123-
-e USE_OAUTH_COOKIE_CLIENT=yes \
124-
--mount type=bind,source=/home/osm/oauth-settings.json,target=/secrets/oauth-settings.json \
125-
-v /big/docker/overpass_db/:/db \
126-
-p 12347:80 \
127-
-i -t \
128-
--name overpass_monaco wiktorn/overpass-api
129-
```
130-
131156
## Healthcheck checking that instance is up-to-date
132157

133158
Using following environment variable:

0 commit comments

Comments
 (0)