Skip to content

Instantly share code, notes, and snippets.

@jbelien
Last active May 16, 2018 09:43
Show Gist options
  • Save jbelien/6832dee668c87a82dd7321b9b9879a8a to your computer and use it in GitHub Desktop.
Save jbelien/6832dee668c87a82dd7321b9b9879a8a to your computer and use it in GitHub Desktop.
OpenStreetMap History Compare
# Source: https://github.com/osmcode/osmium-tool/blob/master/README.md
sudo apt-get install libboost-program-options-dev libboost-dev libbz2-dev zlib1g-dev libexpat1-dev cmake
mkdir work
cd work
git clone https://github.com/mapbox/protozero
git clone https://github.com/osmcode/libosmium
git clone https://github.com/osmcode/osmium-tool
cd osmium-tool
mkdir build
cd build
cmake ..
make
# Fix printing bounding box
set-geo-bounds 19.777131,41.301352,19.863648,41.349308
set-print-bounds-geo
# Export view (1000 x 1000 pixels)
export-bitmap myfile.png height=1000 width=1000
# Source: http://osmcode.org/osmium-tool/manual.html#working-with-history-files
# Source: http://docs.osmcode.org/osmium/latest/osmium-extract.html
# Source: http://docs.osmcode.org/osmium/latest/osmium-time-filter.html
# Check first and last edit :
./work/osmium-tool/build/osmium fileinfo -e albania-internal.osh.pbf
# If you need to create an extract :
# Use http://boundingbox.klokantech.com/ for the bouding box
./work/osmium-tool/build/osmium extract -b 19.761162,41.298555,19.88905,41.355791 albania-internal.osh.pbf -o tirana-internal.osh.pbf --with-history
# Create files per year :
./work/osmium-tool/build/osmium time-filter -o albania-20080101.osm.pbf albania-internal.osh.pbf 2008-01-01T00:00:00Z
./work/osmium-tool/build/osmium time-filter -o albania-20090101.osm.pbf albania-internal.osh.pbf 2009-01-01T00:00:00Z
./work/osmium-tool/build/osmium time-filter -o albania-20100101.osm.pbf albania-internal.osh.pbf 2010-01-01T00:00:00Z
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment