aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-12-03 22:38:08 +0800
committertypebrook <typebrook@gmail.com>2019-12-03 22:38:08 +0800
commitf2fa7f6237f69bdafcc082dedadfbd52d5c54af1 (patch)
treea152ba95746edd260d3b11543ccf4747963fb25d
parent0f24a51f34c4b548bb9d9ec2f0a24279af351ae2 (diff)
update
-rwxr-xr-xscripts/match.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/match.sh b/scripts/match.sh
index 3c1216a..876b78d 100755
--- a/scripts/match.sh
+++ b/scripts/match.sh
@@ -1,10 +1,11 @@
1#! /bin/bash 1#! /bin/bash
2 2
3#set -x 3#set -x
4set -e
4 5
5ACCESS_TOKEN=$(cat ~/settings/tokens/mapbox) 6ACCESS_TOKEN=$(cat ~/settings/tokens/mapbox)
6#export MAPBOX_ACCESS_TOKEN=$ACCESS_TOKEN 7#export MAPBOX_ACCESS_TOKEN=$ACCESS_TOKEN
7LIMIT=100 8LIMIT=10
8TRK_NAME=$(sed -nr 's/.*<name>(.*)<\/name>.*/\1/p; /<name>/q' $1) 9TRK_NAME=$(sed -nr 's/.*<name>(.*)<\/name>.*/\1/p; /<name>/q' $1)
9 10
10# Need to add pre-process for duplicated gpx trkpts 11# Need to add pre-process for duplicated gpx trkpts
@@ -21,7 +22,6 @@ do
21 jq --slurp '{type: "Feature", properties: {coordTimes: .[1]}, geometry: {type: "LineString", coordinates: .[0]}}' \ 22 jq --slurp '{type: "Feature", properties: {coordTimes: .[1]}, geometry: {type: "LineString", coordinates: .[0]}}' \
22 <(head -$LIMIT origin | cut -d' ' -f2 | jq -n '[inputs]') \ 23 <(head -$LIMIT origin | cut -d' ' -f2 | jq -n '[inputs]') \
23 <(head -$LIMIT origin | cut -d' ' -f1 | jq -nR '[inputs]') |\ 24 <(head -$LIMIT origin | cut -d' ' -f1 | jq -nR '[inputs]') |\
24 tee input.geojson |\
25 curl -X POST -s --header "Content-Type:application/json" --data @- https://api.mapbox.com/matching/v4/mapbox.driving.json?access_token=$ACCESS_TOKEN > response 25 curl -X POST -s --header "Content-Type:application/json" --data @- https://api.mapbox.com/matching/v4/mapbox.driving.json?access_token=$ACCESS_TOKEN > response
26 26
27 jq -c '.features[0].geometry.coordinates[]' response |\ 27 jq -c '.features[0].geometry.coordinates[]' response |\