From be64be8f9da6bc2f7ef76fefcf9951288b4c3940 Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 5 Dec 2019 18:41:26 +0800 Subject: update --- scripts/match-road.sh | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'scripts/match-road.sh') diff --git a/scripts/match-road.sh b/scripts/match-road.sh index 7b6dad4..608fc56 100755 --- a/scripts/match-road.sh +++ b/scripts/match-road.sh @@ -20,9 +20,9 @@ set -e # put yout Mapbox token here ACCESS_TOKEN=$(cat ~/settings/tokens/mapbox) # number of coordinates for each Mapbox Map Matching API request, Maximum value is 100 -LIMIT=50 +LIMIT=10 # define the lowest confidence of accepted matched points -THRESHOLD=0.7 +THRESHOLD=0.3 ORIGIN_DATA=/tmp/$(basename $1).origin MATCHED=/tmp/$(basename $1).matched @@ -30,7 +30,7 @@ MATCHED=/tmp/$(basename $1).matched # extract data from the given gpx file, dump data with format [coordindate] [time_to_second], like: # [121.0179739,14.5515336] 1984-01-01T08:00:46 function get_data() { - sed -nr '// {H; /<\/trkpt>/ {x; s/\n/ /g; p; s/.*//; x}}' $1 |\ + sed -nr '// {H; /<\/trkpt>/ {x; s/\n/ /g; p; s/.*//; x}}' $1 | sed -nr 'h; s/.*lon="([^"]+).*/\1/; H; g s/.*lat="([^"]+).*/\1/; H; g # If trkpt has no time, leave it blank @@ -38,8 +38,8 @@ function get_data() { s/.*