Animovaná história zmien


Ak chcete vytvoriť animáciu zmien pre určitú oblasť, podobnú ako na http://stuffz.l33t.in/osm/, môžete použiť nasledovné skripty:

downloadhistory.sh
#!/bin/bash
area=vrbove
region=17.7041245,48.6089654,17.7372551,48.6366522

# newest file is $from months old
from=2
# oldest file is $to months old
to=55
# note: apparently you cannot go past 0710 (2007-10) because osmchange cannot
#       recognize format that is too old (pre 0.5?)
#
# requires:
# - unzip
# - wget
# - osmchange: http://wiki.openstreetmap.org/wiki/Osmchange_(program)

mkdir $area
seq "${from}" "${to}" | while read -r month
do
ym=$(date -d "${month} months ago" '+%y%m')
wget -q --output-document=- http://download.freemap.sk/slovakia.osm/monthly/slovakia${ym}.zip | funzip - | ./osmchange32 -b="${region}" >"${area}/${area}-${ym}.osm"
done
exit 0


makereports.sh
#!/bin/bash
# required:
# - useractivity perl script: http://wiki.openstreetmap.org/wiki/UserActivity
# - imagemagick

area=vrbove
resolution=1024
c=0

find "${area}" -name "*osm"  | sort | awk '{if (a!="")print a,$0; a=$0}' | while read -r i; do
./useractivity.pl $i ${area}/$(printf "%03d" $c).htm P 5 "${resolution}"
c=$((c+1))
done

# can be quite a memory hog
convert -loop 1 -delay 30 ${area}/*.png ${area}-animated.gif

exit 0


Použitie


Nainštalujte závislosti (viď komentáre v skriptoch)
Uložte si a upravte skripty (area, region, from-to, cesta k useractivity.pl, osmchange32)
Spustite downloadhistory.sh, ktorý stiahne históriu (po mesiacoch) pre zadanú oblasť - vymažte súbory staršie ako október 2007
Spustite makereports.txt
Ak všetko pôjde dobre, výsledkom by mal byť animovaný gif

Testované na Debiane, ale teoreticky by to malo fungovať aj na Win32/Cygwin.
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki