- 将Feed格式转换为pbf格式,然后使用Osmosis处理。
示例代码:
将OSM XML格式转换为pbf格式
osmconvert input.osm --out-pbf > output.pbf
使用Osmosis处理pbf格式
osmosis --read-pbf input.pbf --write-pbf output.pbf
- 使用Planet Stream中的Osmosis模块处理Feed格式。
示例代码:
wget https://planet.openstreetmap.org/planet/full-history/full_history.osm.gz
gunzip full_history.osm.gz
osmosis --read-xml file=full_history.osm --write-pbf file=full_history.pbf
使用Osmosis处理JSON格式
wget https://planet.openstreetmap.org/replication/day/000/000/005/state.txt
osmosis --read-replication-interval workingDirectory=/var/lib/osmosis --simplify-change --write-json-change file=changes.json
osmosis --read-change file=changes.json --read-pbf file=base.pbf --apply-change --write-pbf file=updated.pbf