forked from Baseng0815/OpenData_Hackathon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
executable file
·40 lines (33 loc) · 898 Bytes
/
main.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# usage examples:
# ./main.sh
# ./main.sh -s mein_höhenprofil.png
# ./main.sh "hauptbahnhof, marburg" "lahnberge"
# ./main.sh -s mein_höhenprofil.png "hauptbahnhof, marburg" "lahnberge"
cur="$(dirname $0)" # current directory
visualize_cmd="$cur/python_scripts/visualize.py"
while [[ "$1" == -* ]]; do
case "$1" in
-s|--save)
shift
visualize_cmd="$cur/python_scripts/visualize.py -s $1"
;;
-*)
echo "Flag '$1' not supported"
;;
esac
shift
done
points=""
if [ $# -eq 0 ]; then
points="$("$cur/point_to_lat/point_to_lat")"
else
points="$("$cur/python_scripts/geocode.py" "$@")"
fi
# at least two points have to be selected, otherwise exit
if [ "$(echo "$points" | wc -l)" -lt 2 ]; then
exit
fi
echo "$points" | \
"$cur/python_scripts/lat_to_height.py" | \
$visualize_cmd