From 8e092292342421a6216983afee2cba27e3b61f76 Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 6 Dec 2019 14:15:49 +0800 Subject: update --- scripts/match-road.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts') diff --git a/scripts/match-road.sh b/scripts/match-road.sh index 608fc56..1c8f28b 100755 --- a/scripts/match-road.sh +++ b/scripts/match-road.sh @@ -24,7 +24,9 @@ LIMIT=10 # define the lowest confidence of accepted matched points THRESHOLD=0.3 +if [[ -z $1 ]]; then echo "You need to give a gpx file!"; exit 1; fi ORIGIN_DATA=/tmp/$(basename $1).origin +RESPONSES=/tmp/$(basename $1).responses && true > $RESPONSES MATCHED=/tmp/$(basename $1).matched # extract data from the given gpx file, dump data with format [coordindate] [time_to_second], like: @@ -130,9 +132,17 @@ while [ -s $ORIGIN_DATA ]; do head -$LIMIT $ORIGIN_DATA | make_geojson | query_matched_points | + tee -a $RESPONSES | + tee /dev/tty | validate_matched_points # Remove processed raw data + echo $LIMIT of $(wc -l $ORIGIN_DATA) > /dev/tty sed -i "1,$LIMIT d" $ORIGIN_DATA done | make_geojson > test.geojson + +RAW_RESPONSE=$(basename $1 | tr '.' '_')_response.geojson +MATCHED_POINTS=$(basename $1 | tr '.' '_')_matched.geojson +jq . $RESPONSES | jq -s '.[0].features=[.[]|.features[]] | .[0] | del(.code)' > $RAW_RESPONSE +jq '.features=(.features|map(.geometry.coordinates=.properties.matchedPoints))' $RAW_RESPONSE > $MATCHED_POINTS -- cgit v1.2.3-70-g09d2