diff options
| -rwxr-xr-x | scripts/match.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/match.sh b/scripts/match.sh new file mode 100755 index 0000000..22f3658 --- /dev/null +++ b/scripts/match.sh | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #! /bin/bash | ||
| 2 | |||
| 3 | #set -x | ||
| 4 | |||
| 5 | ACCESS_TOKEN=$(cat ~/settings/tokens/mapbox) | ||
| 6 | |||
| 7 | #paste -d' ' \ | ||
| 8 | # <(sed -nr '/<trk>/,/<\/trk>/ { s/.*<time>(.*)<\/time>/\1/p }' $1 | xargs -I {} date -d "{}" +%s --utc) \ | ||
| 9 | # <(sed -nr 's/.*lon=\"([^\"]+)\" lat=\"([^\"]+)\".*/\1 \2/p' $1) | ||
| 10 | |||
| 11 | sed -nr 's/.*lon=\"([^\"]+)\" lat=\"([^\"]+)\".*/\1,\2/p' $1 |\ | ||
| 12 | xargs -L100 echo -n |\ | ||
| 13 | echo jojo | ||
| 14 | #tr ' ' ';' |\ | ||
| 15 | #sed 's/^/coordinates=/' |\ | ||
| 16 | #curl -X POST \ | ||
| 17 | # --data @- \ | ||
| 18 | # https://api.mapbox.com/matching/v4/mapbox/driving?access_token=$ACCESS_TOKEN&geometries=geojson&steps=true | ||
| 19 | |||