aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/match-road.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/match-road.sh')
-rwxr-xr-xscripts/match-road.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/match-road.sh b/scripts/match-road.sh
index be8d78a..499f6e0 100755
--- a/scripts/match-road.sh
+++ b/scripts/match-road.sh
@@ -46,12 +46,12 @@ do
46 # Put matched points and indices into tmp file 46 # Put matched points and indices into tmp file
47 paste -d' ' \ 47 paste -d' ' \
48 <(jq -c '.features[0].properties.matchedPoints[]' $RESPONSE) \ 48 <(jq -c '.features[0].properties.matchedPoints[]' $RESPONSE) \
49 <(jq -c '.features[0].properties.indices[]' $RESPONSE | xargs -I{} echo {}+1 | bc | xargs -I{} sed -n {}p $ORIGIN_DATA | cut -d' ' -f1 | date -f - +%s) \ 49 <(jq -c '.features[0].properties.indices[]' $RESPONSE | xargs -I{} echo {}+1 | bc | xargs -I{} sed -n {}p $ORIGIN_DATA | cut -d' ' -f1) \
50 > $MATCHED 50 > $MATCHED
51 51
52 # FIXME temporary solution for timestamp to unmatched points 52 # FIXME temporary solution for timestamp to unmatched points
53 DURATION=$(jq '.features[0].properties.duration' $RESPONSE) 53 DURATION=$(jq '.features[0].properties.duration' $RESPONSE)
54 INTERVAL=$(echo "scale=2;" $DURATION / $LIMIT | bc -l) 54 INTERVAL=$(echo "scale=2;" $DURATION / $LIMIT | tee >(cat >> log) | bc -l)
55 55
56 # For each coodinates from Map Matching API, add timestamp at the end and print it out to tty 56 # For each coodinates from Map Matching API, add timestamp at the end and print it out to tty
57 jq -c '.features[0].geometry.coordinates[]' $RESPONSE |\ 57 jq -c '.features[0].geometry.coordinates[]' $RESPONSE |\
@@ -61,7 +61,7 @@ do
61 TIMESTAMP=$(head -1 $MATCHED | cut -d' ' -f2) 61 TIMESTAMP=$(head -1 $MATCHED | cut -d' ' -f2)
62 sed -i 1d $MATCHED 62 sed -i 1d $MATCHED
63 else 63 else
64 echo $line $(echo $TIMESTAMP + $INTERVAL | bc -l) 64 echo $line "$TIMESTAMP.5"
65 fi 65 fi
66 done |\ 66 done |\
67 tee /dev/tty && rm $MATCHED 67 tee /dev/tty && rm $MATCHED