|
@@ -1,7 +1,36 @@
|
|
|
#!/bin/bash
|
|
|
|
|
|
DATE=$(date +%y%m%d_%H%M%S)
|
|
|
+../read_nmea.py > /ramfs/.out
|
|
|
raspistill -o /ramfs/$DATE.jpg
|
|
|
+
|
|
|
+DATA=$(cat /ramfs/.out)
|
|
|
+NS=$(echo $DATA| tr ' ' '\n' | grep NS | cut -d'=' -f2 | cut -d',' -f1)
|
|
|
+EW=$(echo $DATA| tr ' ' '\n' | grep EW | cut -d'=' -f2 | cut -d',' -f1)
|
|
|
+
|
|
|
+LAT=$(echo $DATA| tr ' ' '\n' | grep 'lat=' | cut -d'=' -f2 | cut -d',' -f1)
|
|
|
+LATD=$(../convert_ll_dec.py $LAT | grep "d:" | cut -d':' -f1)
|
|
|
+LATM=$(../convert_ll_dec.py $LAT | grep "d:" | cut -d':' -f1)
|
|
|
+LATS=$(../convert_ll_dec.py $LAT | grep "d:" | cut -d':' -f1)
|
|
|
+
|
|
|
+LON=$(echo $DATA| tr ' ' '\n' | grep 'lon=' | cut -d'=' -f2 | cut -d',' -f1)
|
|
|
+LOND=$(../convert_ll_dec.py $LON| grep "d:" | cut -d':' -f1)
|
|
|
+LONM=$(../convert_ll_dec.py $LON | grep "d:" | cut -d':' -f1)
|
|
|
+LONS=$(../convert_ll_dec.py $LON | grep "d:" | cut -d':' -f1)
|
|
|
+
|
|
|
+# Creation du script pour ajout des données Exif dans le JPG
|
|
|
+cat <<EOF > /ramfs/.conf_exif
|
|
|
+ # Ajouter aux metadatas les informations de geolocalisation
|
|
|
+ # 'add' pour ajouter les informations
|
|
|
+ # 'set' pour remplacer celles déjà exisante
|
|
|
+ # 'del' pour les supprimer (sans préciser de valeur)
|
|
|
+ add Exif.GPSInfo.GPSLatitudeRef ${NS}
|
|
|
+ add Exif.GPSInfo.GPSLatitude ${LATD}/1 ${LATM}/1 ${LATS}/6
|
|
|
+ add Exif.GPSInfo.GPSLongitudeRef ${EW}
|
|
|
+ add Exif.GPSInfo.GPSLongitude ${LOND}/1 ${LONM}/1 ${LONS}/6
|
|
|
+EOF
|
|
|
+
|
|
|
+exiv2 -m /ramfs/.conf_exif /ramfs/$DATE.jpg
|
|
|
echo "Picz $DATE.jpg saved in RAM"
|
|
|
cp /ramfs/$DATE.jpg ~/_Pictures
|
|
|
echo "Picz $DATE.jpg saved to SDCARD"
|