aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-12-03 02:40:41 +0800
committertypebrook <typebrook@gmail.com>2019-12-03 02:40:41 +0800
commitb6ffa8b746eed0aa2f1032fbc9f2b45a875e6f15 (patch)
tree19252fadf498b8478f8c02af71600caa28c90f85 /scripts
parent3a937275bca2728a544a7284ae12ea567787152f (diff)
update
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/match.sh19
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
5ACCESS_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
11sed -nr 's/.*lon=\"([^\"]+)\" lat=\"([^\"]+)\".*/\1,\2/p' $1 |\
12xargs -L100 echo -n |\
13echo 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