source: subversion/applications/utils/downloading/maps4glopus/runner.sh @ 30595

Last change on this file since 30595 was 6029, checked in by hakan, 12 years ago

Use Wine to create GMF's

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1#! /bin/sh
2
3HERE=$(dirname $0)
4HERE=/home/osm/maps4glopus
5
6
7#
8#
9#
10fetch_map() {
11
12    coords=$1
13    where=$(echo $2 | tr "[:upper:]" "[:lower:]")_$(echo $1 | sed -e 's|,|_|g')
14    neighbors=${3:-2}
15    size=${4:-2}
16
17    echo $*
18
19    [ ! -d ${HERE}/logs ] && mkdir ${HERE}/logs
20
21    rm -rf ${HERE}/map
22
23    ${HERE}/../taho/taho.pl -tilename=${coords} -size=${size} -neighbormaps=${neighbors} > ${HERE}/logs/taho-${where}.log
24
25    [ ! -d ${HERE}/map.full ] && mkdir ${HERE}/map.full
26    cp -arl ${HERE}/map/*.png ${HERE}/map.full
27    cp -arl ${HERE}/map/*.kal ${HERE}/map.full
28
29    rm -rf ${HERE}/map.${where}
30    mkdir ${HERE}/map.${where}
31    mv ${HERE}/map/*.png  ${HERE}/map.${where}
32    mv ${HERE}/map/*.kal  ${HERE}/map.${where}
33    rm -rf ${HERE}/map.${where}/*.log
34
35    find ${HERE}/map.${where} -name \*.kal -print0 | xargs -I '{}' -0 cat '{}' | \
36        cat > ${HERE}/map.full/kals.${where}.txt
37
38    GMF_GENERATE=${HERE}/gmf-generate
39    GMF_GENERATE="wine /home/hakan/Archive/2007/2007-11/geotools-dev-bin-2007-11-11/mingw/gmf-generate.exe"
40    find ${HERE}/map.${where} -name \*.kal -print0 | xargs -I '{}' -0 cat '{}' | \
41        ${GMF_GENERATE} ${HERE}/map.${where} ${HERE}/map.full/${where}.gmf > ${HERE}/logs/gmf-generate-${where}.log
42
43    [ ! -d ${HERE}/map.kml ] && mkdir ${HERE}/map.kml
44    GMF_INDEX=${HERE}/gmf-index
45    GMF_INDEX="wine /home/hakan/Archive/2007/2007-11/geotools-dev-bin-2007-11-11/mingw/gmf-index.exe"
46    ${GMF_INDEX} ${HERE}/map.full/${where}.gmf >  ${HERE}/map.${where}/zzz-${where}.kml
47    cp ${HERE}/map.${where}/zzz-${where}.kml ${HERE}/map.kml/${where}.kml
48
49    rm -f ${HERE}/map.${where}/*.kal
50
51    # rm -rf ${HERE}/map
52}
53
54
55
56#
57#
58#
59cd ${HERE}
60
61rm -rf ${HERE}/map.full
62
63# rm -rf ${HERE}/map.kml
64
65
66#
67#
68#
69
70# 2177 / 1421 / 12 / Germering
71fetch_map 14,8709,5686 Germering
72fetch_map 14,8714,5686 Germering
73fetch_map 14,8709,5691 Gauting
74
75# 2179 / 1421 / 12 / Germering
76fetch_map 12,2179,1421 Muenchen
77fetch_map 14,8719,5686 Muenchen
78
79
80
81
82#
83#  Re-create full gmf file
84#
85where=full.de
86
87rm -rf ${HERE}/tostick/map.tiles/de
88
89mkdir -p ${HERE}/tostick/map.tiles/de
90cp ${HERE}/map.full/*.kal ${HERE}/tostick/map.tiles/de
91cp ${HERE}/map.full/*.png ${HERE}/tostick/map.tiles/de
92
93# mkdir ${HERE}/tostick/map.gmf
94# cp ${HERE}/map.full/*.gmf ${HERE}/tostick/map.gmf
95
96mkdir ${HERE}/tostick/glopus
97cp /home/archive/export/GPS-Tracks/Waypoints.asc  ${HERE}/tostick/glopus
98
99chmod a+w ${HERE}/tostick/map.tiles/de
100
101
102
103#########
104#
105#
106#
107#
108
109
110rm -rf ${HERE}/map.full
111
112
113## fetch_map 12,2370,1595 Marmaris     # (1596, lieber y-1, damit Marmaris am unteren Rand bleibt)
114
115## fetch_map 12,2385,1604 Kas          # (1605, lieber y-1, damit Kas am unteren Rand bleibt)
116
117## fetch_map 12,2397,1594 Antalya      # (1595, lieber y-1, damit Antalya am unteren Rand bleibt)
118
119fetch_map 12,2406,1598 Manavgat     # (2405,1597, lieber x+1, y+1 damit es im Zentrum bleibt)
120
121# Degirmen Lokantasi, 12,2409,1596
122fetch_map 12,2409,1596 Degirmen
123fetch_map 14,9638,6385 Degirmen
124
125fetch_map 12,2412,1600 Alanya
126fetch_map 12,2409,1599 Alanya 0
127fetch_map 12,2408,1599 Alanya 0
128
129# 2392 / 1583 / 12 / Burdur
130## fetch_map 12,2392,1583 Burdur
131
132# 2395 / 1583 / 12 / Isparta
133## fetch_map 12,2395,1583 Isparta
134
135# 2402 / 1595 / 12 / Melek Ciftligi
136## fetch_map 12,2401,1595 Melek_Ciftligi # (2402,1595, lieber x-1 damit es nicht mit Manavgat kollodiert)
137# fetch_map 13,4804,3190 Melek_Ciftligi
138
139# 2392 / 1580 / 12 / Keciborlu
140## fetch_map 12,2392,1580 Keciborlu
141# fetch_map 13,4785,3161 Keciborlu
142# fetch_map 14,9571,6322 Keciborlu
143
144#
145#  Re-create full gmf file
146#
147where=full.tr
148
149rm -rf ${HERE}/tostick/map.tiles/tr
150
151mkdir -p ${HERE}/tostick/map.tiles/tr
152cp ${HERE}/map.full/*.kal ${HERE}/tostick/map.tiles/tr
153cp ${HERE}/map.full/*.png ${HERE}/tostick/map.tiles/tr
154
155# cp ${HERE}/map.full/*.gmf ${HERE}/tostick/map.gmf
156
157mkdir ${HERE}/tostick/glopus
158cp /home/archive/export/GPS-Tracks/Waypoints.asc  ${HERE}/tostick/glopus
159
160chmod a+w ${HERE}/tostick/map.tiles/tr
161
162
163
164#
165#
166#
167mkdir ${HERE}/tostick/map.gmf
168
169chmod a+w ${HERE}/tostick/map.gmf
170
Note: See TracBrowser for help on using the repository browser.