Dabei bin ich auf das tolle Python-Script heatmap.py gestossen. Mein Bewegungsmuster für 2010 sieht dann so aus:
Um aus den rund 40 MByte GPX-Daten mit über 400 000 Datenpunkten dieses Bild zu berechnen, benötigt meine Atom-Maschine knapp 20 Minuten. Ums schnell nochmal für 2009 zu machen habe ich dann folgendes Script geschrieben:
>#!/bin/bash
## dieses Script verbindet viele GPX-Dateien und macht mit heatmap.py eine Karte daraus
START=$(date +%s)
progbar(){
p=$1
while [ -d /proc/$p ]
do
echo -e '.' ; sleep 1
done
}
echo -e '\E[33m(00) GPX-Dateien finden und in Unterordner kopieren'; tput sgr0
find /sourcedir/ -iname "2009-*.gpx" -exec cp {} /destinationdir/gpx/2009/ \; & progbar $!
echo -e '\E[33m(00) GPX-Dateien verbinden, überflüssige XML-Tags entfernen'; tput sgr0
## merge all gpx files
cat gpx/2009/*.gpx > temp1.gpx & progbar $!
## remove the duplicate headers and footers
sed '/^<?xml.*$/d' temp1.gpx > temp2.gpx & progbar $!
sed '/^<gpx.*$/d' temp2.gpx > temp3.gpx & progbar $!
sed '/^<\/gpx.*$/d' temp3.gpx > temp5.gpx & progbar $!
# reinsert one header and one footer
echo "<?xml version='1.0' encoding='UTF-8'?>" > 2009.gpx
echo "<gpx version='1.1' creator='GPSMID' xmlns='http://www.topografix.com/GPX/1/1'>" >> 2009.gpx
cat temp5.gpx >> 2009.gpx & progbar $!
echo "</gpx>" >> 2009.gpx
# remove the temporary files
rm temp*.gpx
echo -e '\E[33m(00) Heatmap erstellen'; tput sgr0
# invoke heatmap.py
python heatmap.py --gpx=2009.gpx --output=2009-DD.png --verbose \
--projection=equirectangular --extent=50.96,13.39,51.22,13.93 \
--background=black --radius=5 --gradient=rainbow.png \
--width=2048
END=$(date +%s)
DIFF=$(( $END - $START ))
echo -e '\E[33mFertig in '$DIFF' Sekunden'; tput sgr0
Für 2009 macht das dann ähnliches Bild:
Keine Kommentare:
Kommentar veröffentlichen