From f2fa7f6237f69bdafcc082dedadfbd52d5c54af1 Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 3 Dec 2019 22:38:08 +0800 Subject: update --- scripts/match.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts') 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 @@ #! /bin/bash #set -x +set -e ACCESS_TOKEN=$(cat ~/settings/tokens/mapbox) #export MAPBOX_ACCESS_TOKEN=$ACCESS_TOKEN -LIMIT=100 +LIMIT=10 TRK_NAME=$(sed -nr 's/.*(.*)<\/name>.*/\1/p; //q' $1) # Need to add pre-process for duplicated gpx trkpts @@ -21,7 +22,6 @@ do jq --slurp '{type: "Feature", properties: {coordTimes: .[1]}, geometry: {type: "LineString", coordinates: .[0]}}' \ <(head -$LIMIT origin | cut -d' ' -f2 | jq -n '[inputs]') \ <(head -$LIMIT origin | cut -d' ' -f1 | jq -nR '[inputs]') |\ - tee input.geojson |\ curl -X POST -s --header "Content-Type:application/json" --data @- https://api.mapbox.com/matching/v4/mapbox.driving.json?access_token=$ACCESS_TOKEN > response jq -c '.features[0].geometry.coordinates[]' response |\ -- cgit v1.2.3-70-g09d2