|
|
# Updating datasets
|
|
|
|
|
|
## List of commands
|
|
|
|
|
|
##### Update the complete planet file
|
|
|
osmupdate planet-latest.osm.pbf planet-latest-updated.osm.pbf [[--hour] --day]
|
|
|
|
|
|
##### Generate a .o5c change file between old and current planet
|
|
|
osmupdate [--keep-tempfiles] [[--hour] --day] planet-latest.osm.pbf planet-update.o5c
|
|
|
|
|
|
## Workflow variants
|
|
|
|
|
|
1. Always make new extracts from the updated planet file using `osmconvert`
|
|
|
2. Update the planet and keep temp files (`osmupdate --keep-tempfiles`). Apply `osmupdate [-b | -B] --keep-tempfiles` on extract files. This reuses the downloaded diffs.
|
|
|
3. Use `osmupdate planet.pbf diff.o5c` to generate a diff between old and current planet. Apply the .o5c file to the extracts (is this possible?) and to the planet to update these files. The .o5c file should also be usable to update databases with osmosis/osm2pgsql according to http://wiki.openstreetmap.org/wiki/Osmupdate#Assembling_an_OSM_Change_file .
|
|
|
|
|
|
# Extracting data
|
|
|
|
|
|
## osmosis
|
|
|
|
|
|
##### Installation (Ubuntu)
|
|
|
|
|
|
sudo apt-get install osmosis
|
|
|
|
|
|
##### bbox
|
|
|
|
|
|
export JAVACMD_OPTIONS=-server;
|
|
|
export JAVACMD_OPTIONS=-Xmx2G;
|
|
|
osmosis --read-pbf file=$pbfinfile --bounding-box top=$maxlat left=$minlon bottom=$minlat right=$maxlon --write-pbf file=$pbfoutfile
|
|
|
|
|
|
##### poly
|
|
|
|
|
|
export JAVACMD_OPTIONS=-server;
|
|
|
export JAVACMD_OPTIONS=-Xmx2G;
|
|
|
osmosis --read-pbf file="$pbfinfile" --bounding-polygon file="$polyfile" --write-pbf file="$pbfoutfile"
|
|
|
|
|
|
##### Tuning
|
|
|
|
|
|
http://wiki.openstreetmap.org/wiki/Osmosis/Tuning
|
|
|
|
|
|
## osmconvert
|
|
|
|
|
|
##### Installation (Ubuntu)
|
|
|
|
|
|
sudo apt-get install osmctools
|
|
|
|
|
|
##### bbox
|
|
|
osmconvert $pbfinfile -b=$minlon,$minlat,$maxlon,$maxlat --out-pbf [--complete-ways | --complex-ways] -o=$pbfoutfile --hash-memory=2000
|
|
|
|
|
|
##### poly
|
|
|
osmconvert $pbfinfile -B=$polyfile --out-pbf [--complete-ways | --complex-ways] -o=$pbfoutfile --hash-memory=2000
|
|
|
|
|
|
##### Tuning
|
|
|
osmconvert --help
|
|
|
|
|
|
## osmchange
|
|
|
|
|
|
Keine Unterstützung für .pbf / .o5m Dateien.
|
|
|
|
|
|
##### Installation (Ubuntu)
|
|
|
|
|
|
???
|
|
|
|
|
|
##### bbox
|
|
|
|
|
|
<$osminfile ./osmchange -b=$minlon,$minlat,$maxlon,$maxlat >$osmoutfile
|
|
|
|
|
|
#### poly
|
|
|
|
|
|
<$osminfile ./osmchange -B=$polyfile >$osmoutfile
|
|
|
|
|
|
|
|
|
## Benchmarks
|
|
|
|
|
|
##### osmosis bbox
|
|
|
time osmosis --read-pbf file=switzerland-latest.osm.pbf --bounding-box top=47 left=7 bottom=46 right=8 --write-pbf file=osmosis-out.pbf
|
|
|
0m25
|
|
|
|
|
|
##### osmosis poly
|
|
|
time osmosis --read-pbf file="switzerland-latest.osm.pbf" --bounding-polygon file="polygon.poly" --write-pbf file="osmosis-out.pbf"
|
|
|
1m05
|
|
|
|
|
|
##### osmconvert bbox
|
|
|
time osmconvert switzerland-latest.osm.pbf -b=7,46,8,47 --out-pbf -o=osmconvert-out.pbf
|
|
|
0m10
|
|
|
|
|
|
time osmconvert planet-150119.osm.pbf -b=7,46,8,47 --out-pbf -o=osmconvert-out.pbf --hash-memory=2000
|
|
|
14m22
|
|
|
|
|
|
##### osmconvert poly
|
|
|
time osmconvert switzerland-latest.osm.pbf -B=polygon.poly --out-pbf -o=osmconvert-out.pbf
|
|
|
0m18
|
|
|
|
|
|
# Aufschneiden in 1° Kacheln
|
|
|
|
|
|
http://wiki.openstreetmap.org/wiki/User:Computerteddy#Software
|
|
|
|
|
|
# Voraussetzungen:
|
|
|
|
|
|
- Multipolygon, aber nicht selbst-überschneidend.
|
|
|
|
|
|
# Zu klären
|
|
|
|
|
|
- Sich selbst überschneidende Polygonlinie (ok, oder muss es abgefangen werden)
|
|
|
- bbox über Datumsgrenze -> vertagen
|
|
|
- Grenzüberlappende Linien, Relationen (osmconvert: Flächen) abschneiden oder behalten? -> Behalten.
|
|
|
- Werden folgende Daten benötigt?
|
|
|
- Autor -> Verwerfen
|
|
|
- Erstellungsdatum -> Verwerfen
|
|
|
- Versionsnummer -> Verwerfen
|
|
|
- ... -> Verwerfen
|
|
|
- Dokumentationssprache? -> Englisch |