diff options
author | typebrook <typebrook@gmail.com> | 2019-08-15 23:51:40 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2019-08-15 23:51:40 +0800 |
commit | 8daf16baa75f048574216a21234f90363b56cdf5 (patch) | |
tree | a09514563d31a8da3238a39c75fbbf2a27c181d6 | |
parent | fb43491d084fbdcbc82ab7cc93b9cce0e37aa15b (diff) |
update
-rw-r--r-- | alias | 1 | ||||
-rw-r--r-- | scripts/mvt_decode.py | 14 |
2 files changed, 15 insertions, 0 deletions
@@ -146,6 +146,7 @@ alias hp='http-prompt' | |||
146 | alias clocg='cloc --vcs=git' | 146 | alias clocg='cloc --vcs=git' |
147 | alias tma='tmux a' | 147 | alias tma='tmux a' |
148 | alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm' | 148 | alias mm='mkvmerge -o out.webm -w 01.webm + 02.webm' |
149 | alias mvt_decode='python3 $SETTING_DIR/scripts/mvt_decode.py' | ||
149 | alias big52utf8='_big52utf8' | 150 | alias big52utf8='_big52utf8' |
150 | _big52utf8() { | 151 | _big52utf8() { |
151 | iconv -f BIG-5 -t UTF-8 $1 > $1.utf8 | 152 | iconv -f BIG-5 -t UTF-8 $1 > $1.utf8 |
diff --git a/scripts/mvt_decode.py b/scripts/mvt_decode.py new file mode 100644 index 0000000..6e42006 --- /dev/null +++ b/scripts/mvt_decode.py | |||
@@ -0,0 +1,14 @@ | |||
1 | import mapbox_vector_tile | ||
2 | import sys | ||
3 | |||
4 | #Python3 | ||
5 | |||
6 | mvt = sys.argv[1] | ||
7 | |||
8 | print(mvt) | ||
9 | |||
10 | with open(mvt, 'rb') as f: | ||
11 | data = f.read() | ||
12 | decoded_data = mapbox_vector_tile.decode(data) | ||
13 | with open(mvt + '_decode.txt', 'w') as f: | ||
14 | print(decoded_data) | ||