From 8df5dd9620dfa1462b6973d393f6891b612ae256 Mon Sep 17 00:00:00 2001 From: User Erdgeist Date: Sat, 1 Feb 2014 09:05:48 +0000 Subject: Add support for exporting geo coordinates for new format --- src/makecolumns.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/makecolumns.sh') 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() { # Compile all the binaries make all - mkdir -p ../work_`basename $1` - cd ../work_`basename $1` || exit 1 + mkdir -p ../work_`basename ${1#white_}` + cd ../work_`basename ${1#white_}` || exit 1 unset strassen; [ -f $1/dat/strassen.dat ] && strassen=$1/dat/strassen.dat @@ -36,6 +36,7 @@ main() { else echo "Not a recognized Telefonbuch folder" fi + cd .. } get_dword() { @@ -48,7 +49,7 @@ handle_old_format() { # Clear old files. Be very careful, we could # have ended up in an unexpected directory, after all. find -E . -depth 1 -regex '^\./[0123456789]+' -delete - rm ??_* + rm -f ??_* # If street names come in an extra file, extract # street names first @@ -166,6 +167,16 @@ handle_new_format() { cat file_* > streets rm file_* + if [ -f $1/zip-streets-hn-geo.tl ]; then + ../bin/decompress $1/zip-streets-hn-geo.tl + cat file_* | tr '\n\0' '\t\n' > 90_Geokoordinaten_hnr + rm file_* + elif [ -f $1/zip-streets-geo.tl ]; then + ../bin/decompress $1/zip-streets-geo.tl + cat file_* | tr '\n\0' '\t\n' > 91_Geokoordinaten_str + rm file_* + fi + ../bin/decompress $1/phonebook.db numfiles=`find . -name file_\* | wc -l` -- cgit v1.2.3