0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

gpsbabel基本コマンド

Last updated at Posted at 2019-08-21

kml を gpx に変換

gpsbabel -t -i kml -f [input filename] -o gpx -F [output filename]

kml を csv に変換

gpsbabel -t -i kml -f [input filename] -o unicsv -F [output filename]

他にテキストで使いやすい形式としては、"openoffice" 形式もある.

複数のgpxを統合する(タイムスタンプでソートされる)

gpsbabel -t -i gpx -f [input1] -i gpx -f [input2] -x track,merge,title="combined" -o gpx -F [output]

時間の無いgpxに時間を付与する(combine用)

# !/bin/bash
  
input=$1
output=$2

tmp1=`mktemp temp.XXXX`
tmp2=`mktemp temp.XXXX`
tmp3=`mktemp temp.XXXX`
tmp4=`mktemp temp.XXXX`
tmp5=`mktemp temp.XXXX`


gpsbabel -t -i gpx -f ${input} -o csv -F ${tmp1}
cat -n ${tmp1} | sed 's/,//g' | awk 'BEGIN{OFS=","}{print $1,$2,$3,"",""}' > ${tmp2}

count=0
cat ${tmp2} | while read line
do
   count=$(expr $count + 1)
# for mac(BSD)
   date -v+${count}S -j -f "%Y/%m/%d %T" "2013/09/21 12:00:00" "+,%Y/%m/%d, %T" >> ${tmp3}
done

paste ${tmp2} ${tmp3} | sed 's/ //g' > ${tmp4}

echo "No,Latitude,Longitude,Name,Altitude,Date,Time" > header
cat header ${tmp4} > ${tmp5}
gpsbabel -t -i unicsv -f ${tmp5} -o gpx -F ${output}
mv ${tmp5} ${output}.csv

rm temp.*
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?