diff options
author | User Erdgeist <erdgeist@avon.ccc.de> | 2014-02-01 09:05:48 +0000 |
---|---|---|
committer | User Erdgeist <erdgeist@avon.ccc.de> | 2014-02-01 09:05:48 +0000 |
commit | 8df5dd9620dfa1462b6973d393f6891b612ae256 (patch) | |
tree | 88a94909e32f435069993c024ab0db550b7885cd | |
parent | d43b806acb50c9bd5cf309362fa5c5119058827f (diff) |
Add support for exporting geo coordinates for new format
-rw-r--r-- | src/makecolumns.sh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/makecolumns.sh b/src/makecolumns.sh index 016f6de..4666f3f 100644 --- a/src/makecolumns.sh +++ b/src/makecolumns.sh | |||
@@ -21,8 +21,8 @@ main() { | |||
21 | # Compile all the binaries | 21 | # Compile all the binaries |
22 | make all | 22 | make all |
23 | 23 | ||
24 | mkdir -p ../work_`basename $1` | 24 | mkdir -p ../work_`basename ${1#white_}` |
25 | cd ../work_`basename $1` || exit 1 | 25 | cd ../work_`basename ${1#white_}` || exit 1 |
26 | 26 | ||
27 | unset strassen; [ -f $1/dat/strassen.dat ] && strassen=$1/dat/strassen.dat | 27 | unset strassen; [ -f $1/dat/strassen.dat ] && strassen=$1/dat/strassen.dat |
28 | 28 | ||
@@ -36,6 +36,7 @@ main() { | |||
36 | else | 36 | else |
37 | echo "Not a recognized Telefonbuch folder" | 37 | echo "Not a recognized Telefonbuch folder" |
38 | fi | 38 | fi |
39 | cd .. | ||
39 | } | 40 | } |
40 | 41 | ||
41 | get_dword() { | 42 | get_dword() { |
@@ -48,7 +49,7 @@ handle_old_format() { | |||
48 | # Clear old files. Be very careful, we could | 49 | # Clear old files. Be very careful, we could |
49 | # have ended up in an unexpected directory, after all. | 50 | # have ended up in an unexpected directory, after all. |
50 | find -E . -depth 1 -regex '^\./[0123456789]+' -delete | 51 | find -E . -depth 1 -regex '^\./[0123456789]+' -delete |
51 | rm ??_* | 52 | rm -f ??_* |
52 | 53 | ||
53 | # If street names come in an extra file, extract | 54 | # If street names come in an extra file, extract |
54 | # street names first | 55 | # street names first |
@@ -166,6 +167,16 @@ handle_new_format() { | |||
166 | cat file_* > streets | 167 | cat file_* > streets |
167 | rm file_* | 168 | rm file_* |
168 | 169 | ||
170 | if [ -f $1/zip-streets-hn-geo.tl ]; then | ||
171 | ../bin/decompress $1/zip-streets-hn-geo.tl | ||
172 | cat file_* | tr '\n\0' '\t\n' > 90_Geokoordinaten_hnr | ||
173 | rm file_* | ||
174 | elif [ -f $1/zip-streets-geo.tl ]; then | ||
175 | ../bin/decompress $1/zip-streets-geo.tl | ||
176 | cat file_* | tr '\n\0' '\t\n' > 91_Geokoordinaten_str | ||
177 | rm file_* | ||
178 | fi | ||
179 | |||
169 | ../bin/decompress $1/phonebook.db | 180 | ../bin/decompress $1/phonebook.db |
170 | 181 | ||
171 | numfiles=`find . -name file_\* | wc -l` | 182 | numfiles=`find . -name file_\* | wc -l` |