metalx1000

latitude and longitude from Raspberry Pi GPS Dump

Jun 23rd, 2017
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.37 KB | None | 0 0
  1. #get and convert GPS data from Raspberry Pi GPS dump
  2. #latitude and longitude
  3.  
  4. #get example file
  5. wget "https://pastebin.com/raw/UFTHkZJz" -O gps.log
  6.  
  7. #get latitude and longitude for use with Google Maps
  8. grep ',N,' gps.log|\
  9. grep ',W,'|\
  10. cut -d\, -f4,6|\
  11. grep ',08'|\
  12. sed "s/./& /2"|\
  13. sed "s/./& /14"|\
  14. while read l;
  15. do
  16.   echo "${l}0'"|\
  17.   sed "s/,0/0',-/g";
  18. done
Add Comment
Please, Sign In to add comment