-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathX_reimport_N_Update.sh
403 lines (322 loc) · 21.4 KB
/
X_reimport_N_Update.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
#/bin/bash!
orange=`tput setaf 11`
bg_orange=`tput setab 178`
purple=`tput setaf 13`
Line=`tput smul`
bold=`tput bold`
black=`tput setaf 0`
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
magenta=`tput setaf 5`
cyan=`tput setaf 6`
white=`tput setaf 15`
reset=`tput sgr0`
bg_red=`tput setab 1`
bg_green=`tput setab 2`
bg_white=`tput setab 7`
bg_blue=`tput setab 4`
lightblue=`tput setaf 45`
lightgreen=`tput setaf 46`
bleuetern=`tput setaf 45`
ilghtpurple=`tput setaf 33`
lightred=`tput setaf 161`
darkblue=`tput setaf 19`
dir=$(
cd -P -- "$(dirname -- "$0")" && pwd -P
)
cd "$dir"
if [ -d tmp/NewLayers ]
then
rm -R tmp/NewLayers
fi
mkdir -p tmp/NewLayers/Layers_by_NodeID
if [ -f tmp/NewLayers/JSWorkspace ]
then
rm tmp/NewLayers/JSWorkspace
fi
# Menu to check the storage and the layer name in javascript
function askYesNo {
QUESTION=$(echo "${white}---> Would you like to round-up files from different Geoserver workspace in a common workspace in the javascript Dynamic Layers ?
${white}---> Common use case: ${orange}The IDC Background from diffrent sources (BHVP, CapGeo, OpenData92, RATP, ...)${white} but in the same workspace to agregate layers in one single layer
${white}---> This rule will have only consequeces on ${orange}Geoserver Workspace ${white}where are stored the GeoTiff and in the ${orange}JavaScript of the dynamic Layers eg. ${green}Workspace:LayerName"
)
DEFAULT=$2
if [ "$DEFAULT" = true ]; then
OPTIONS="${red}[Y/n]"
DEFAULT="y"
else
OPTIONS="${red}[y/N]"
DEFAULT="n"
fi
read -p "$QUESTION $OPTIONS " -n 1 -s -r INPUT
INPUT=${INPUT:-${DEFAULT}}
echo ${INPUT}
if [[ "$INPUT" =~ ^[yY]$ ]]; then
ANSWER=true
else
ANSWER=false
fi
}
askYesNo "Do it?" true
DOIT=$ANSWER
if [ "$DOIT" = true ]; then
read -p "${orange}---> What is the name of the geoserver workspace .eg : IDC ? : ${green}" JavacriptWorkspace
JSWorkspace=$(echo "$JavacriptWorkspace")
echo "$JSWorkspace" > tmp/NewLayers/JSWorkspace
echo "${white}---> $JSWorkspace will be used to print javascript and will have to be use as Workspace ${orange}$JSWorkspace in geoserver"
else
echo "${white}---> The Workspace from files meta data will be used to print javascript"
fi
if [ -f tmp/StorageLocation ]
then
StorageLocation=$(cat tmp/StorageLocation)
read -p "${white}---> The current Storage Location is : ${orange}$StorageLocation (y/n) ? :" RESP
if [ "$RESP" = "y" ]; then
echo "${white}---> Using $StorageLocation as default Storage Location"
else
echo "${white}---> The source files path must be as fellow
eg. /my_folder/3857 /my_folder/pngpreview"
read -p "${white}What is the Storage Location of the maps eg. /my_folder/
Do not forget the tailing / ${green} : " StorageLocation
echo "$StorageLocation" > tmp/StorageLocation
fi
else
read -p "${orange}What is the Storage Location of the maps eg. /my_folder/
Do not forget the tailing / ${green} : " StorageLocation
echo "$StorageLocation" > tmp/StorageLocation
fi
StorageLocation=$(cat tmp/StorageLocation)
#
## Début
#
echo "${white}---> On the distant server list existing geottifs : ${orange} /var/www/carto/sites/all/themes/cdm/bash/List_Geotifs_private_Raw_map.sh"
read -p "${white}---> Hit enter when done!"
echo "${white}---> rapatriement de la liste des calques sur le server"
if [ -f Server_Port.cfg ]
then
echo "${green}---> Server.cfg found"
else
read -p "What is the server name .eg : sous-paris.com ? : " Server_SCP
echo "$Server_SCP" > Server_SCP.cfg
read -p "What is the server port .eg : 1777 ? : " Server_port
echo "$Server_port" > Server_Port.cfg
read -p "What is the server user .eg : philibert ? : " Server_User
echo "$Server_User" > User_SCP.cfg
fi
Port_SCP=$(cat Server_Port.cfg)
Server_SCP=$(cat Server_SCP.cfg)
User_scp=$(cat User_SCP.cfg)
echo "${white}---> From the ${orange}Server_SCP.cfg Server_Port.cfg${white} the server name is${orange} $Server_SCP${white} port ${orange}$Port_SCP"
echo "${white}---> The command shoult be : ${green}scp -P "$Port_SCP" "$User_scp"@"$Server_SCP":/tmp/LISTTIFF/listTiffInServer.csv tmp/NewLayers/listTiffInServer.csv"
scp -P "$Port_SCP" "$User_scp"@"$Server_SCP":/tmp/LISTTIFF/listTiffInServer.csv tmp/NewLayers/listTiffInServer.csv
# List New Layers
find ../_Output_3857/ -name '*.tif' |sed 's/\/\//\//g' > tmp/NewLayers/TheNewGeotiffs.txt
mkdir -p tmp/NewLayers/NewTiffTXT
for TheNewGeotiffslist in $(cat tmp/NewLayers/TheNewGeotiffs.txt)
do
TheFileSourceTIFF=$(echo "$TheNewGeotiffslist"| awk -F/ '{print $NF}')
The_layer_machine_name=$(echo "$TheNewGeotiffslist"| awk -F/ '{print $NF}'| awk '{print tolower($0)}'|sed 's/.tif//g')
exiftool "$TheNewGeotiffslist" |awk '/Keywords/' | sed 's/Keywords : //g' > tmp/NewLayers/NewTiffTXT/"$The_layer_machine_name".txt
echo $white $TheFileSourceTIFF
Server23_NodeID=$(cat tmp/NewLayers/NewTiffTXT/"$The_layer_machine_name".txt | awk -F'|' '{print $23}')
echo $orange $Server23_NodeID
done
if [ -f tmp/all_layers.txt ]
then
rm tmp/all_layers.txt
fi
if [ -f tmp/NewLayers/NewTiffTXT/_CSVall_layers.txt ]
then
rm tmp/NewLayers/NewTiffTXT/_CSVall_layers.txt
fi
IFS=$'\n' # Processing full line (ignoring spaces)
set -f # disable globbing
find tmp/NewLayers/NewTiffTXT/ -name '*.txt' | sed 's/\/\//\//g' > tmp/NewLayers/all_layers.txt
for txt in $(cat tmp/NewLayers/all_layers.txt)
do
cat $txt >> tmp/NewLayers/NewTiffTXT/_CSVall_layers.txt
done
cat tmp/NewLayers/NewTiffTXT/_CSVall_layers.txt |awk -F'|' '{print $23}' |awk '!/./ || !seen[$0]++'| awk NF > tmp/NewLayers/NewTiffTXT/NodeID_To_Update.txt
cat tmp/NewLayers/NewTiffTXT/_CSVall_layers.txt > tmp/NewLayers/AlLMixedLayers.csv
cat tmp/NewLayers/listTiffInServer.csv >> tmp/NewLayers/AlLMixedLayers.csv
cat tmp/NewLayers/AlLMixedLayers.csv | awk NF > tmp/NewLayers/AlLMixedLayers.csvtmp && mv tmp/NewLayers/AlLMixedLayers.csvtmp tmp/NewLayers/AlLMixedLayers.csv
cat tmp/NewLayers/AlLMixedLayers.csv|awk -F'|' '!/./ || !seen[$1]++' > tmp/NewLayers/AlLMixedLayersNODUPES.csv
if [ -f tmp/NewLayers/temp_layers_div_elements.txt ]
then
rm tmp/NewLayers/temp_layers_div_elements.txt
fi
if [ -f tmp/NewLayers/TMPJS.js ]
then
rm tmp/NewLayers/TMPJS.js
fi
echo 'jQuery(document).ready(function($) {
map.openlayers.events.register("moveend", map, function(){
var mapbounds = map.openlayers.getExtent();
bbox = mapbounds.toArray();
var bleft = bbox[0];
var bbottom = bbox[1];
var bright = bbox[2];
var btop = bbox[3];
' > tmp/NewLayers/HidendSeek.js
# update with NodeID_To_Update as driven key
if [ -f tmp/NewLayers/ALL_LAYERS.txt ]
then
rm tmp/NewLayers/ALL_LAYERS.txt
fi
if [ -f tmp/NewLayers/TheCureentNodeBody.csv ]
then
rm tmp/NewLayers/TheCureentNodeBody.csv
fi
IFS=$'\n' # Processing full line (ignoring spaces)
set -f # disable globbing
for newlayersIDs in $(cat tmp/NewLayers/NewTiffTXT/NodeID_To_Update.txt)
do
THELAYERSONELINETIFF=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $18}'|tr '\n' '@' |sed 's/\@$//')
S2_nodetitle=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $2}'|awk "NR == 1" )
S3_field_deptf_seine=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $3}'|awk "NR == 1" )
S4_OldNum=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $4}'|awk "NR == 1" )
#3857
S35_NordOuestBasic=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $35}'|awk "NR == 1" )
S36_SudOuestBasic=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $36}'|awk "NR == 1" )
S37_SudEstBasic=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $37}'|awk "NR == 1" )
S38_NordEstBasic=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $38}'|awk "NR == 1" )
# 27561
S27_NordOuestBasic2571=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $27}'|awk "NR == 1" )
S28_SudOuestBasic2571=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $28}'|awk "NR == 1" )
S29_SudEstBasic2571=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $29}'|awk "NR == 1" )
S30_NordEstBasic2571=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $30}'|awk "NR == 1" )
# 4326
S31_NordOuestBasic4326=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $31}'|awk "NR == 1" )
S32_SudOuestBasic4326=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $32}'|awk "NR == 1" )
S33_SudEstBasic4326=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $33}'|awk "NR == 1" )
S34_NordEstBasic4326=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $34}'|awk "NR == 1" )
S17_WKT=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $17}'|awk "NR == 1" )
S19_Original_RawMapName=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $19}'|tr '\n' '@' |sed 's/\@$//')
S65_The_zips_sources=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $26}'|tr '\n' '@' |sed 's/\@$//')
S68_SourcePNG=$(awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv|awk -F'|' '{print $21}'|tr '\n' '@' |sed 's/\@$//')
awk -F'|' -v "newlayersIDs"="$newlayersIDs" '$23=='newlayersIDs'' tmp/NewLayers/AlLMixedLayersNODUPES.csv OFS='|' |sort -n -t'|' -k22 > tmp/NewLayers/TheCURENTNODE.CSV
IFS=$'\n' # Processing full line (ignoring spaces)
set -f # disable globbing
#read -p "wait here"
for theplanchesinnode in $(cat tmp/NewLayers/TheCURENTNODE.CSV)
do
The_fullname=$(echo "$theplanchesinnode" |awk -F'|' '{print $19}'|awk -F'","' '{print $1"</br> GeoTiff - WGS 84 - Tagged"}')
The_fullnameexerpforTheZipNameTooltip=$(echo "$The_fullname"|awk -F'pouce' '{print $1"pouce"}')
The_CentroidPlanche=$(echo "$theplanchesinnode" |awk -F'|' '{print $40}')
TheZipNameShort=$(echo "$theplanchesinnode" |awk -F'|' '{print $1}'|awk -F'_' '{print $1, $3" .jpg .zip .wld . prj"}' |sed 's/\.tif//g')
# OK
TheOriginalFilename=$(echo "$theplanchesinnode" |awk -F'|' '{print $1}')
The_LayerMachineName=$(echo planche"$theplanchesinnode"|awk -F'|' '{print $1}'|tr '-' '_' | awk '{print tolower($0)}'| sed 's/.tif//g'|tr ' ' '_')
TheLayerMachineName_rm=$(echo "$The_LayerMachineName"_rm)
TheAddLayerMachineName=$(echo add_"$The_LayerMachineName")
echo $purple $TheAddLayerMachineName TheAddLayerMachineName
TheZipLink=$(echo "$theplanchesinnode" |awk -F'|' '{print $26}')
TheZipOnly=$(echo "$TheZipLink" | awk '{print $NF}' FS=/)
theZipWeight=$(ls -lah ../_Output_wld_zip/"$TheZipOnly" | awk '{print $5}')
TheZipNameTooltip=$(echo "$The_fullnameexerpforTheZipNameTooltip <br><b> $theZipWeight" )
HumanReadableName=$(echo "$theplanchesinnode" |awk -F'|' '{print $41}')
PrivatePath=$(echo "$theplanchesinnode" |awk -F'|' '{print "/private_file/Raw_map_EPSG_3857/"$1}')
TiffTooltip=$(echo "$theplanchesinnode" |awk -F'|' '{print $19}'|awk -F'-' '{print $1, $2, $3, $4, "<br>"$5, $6, "<br>"$7, $8, "<br><b>"$9}'|sed 's/ / /g')
Thetop_left4326=$(echo "$theplanchesinnode" | awk -F'|' '{print $13}')
Thebottom_left4326=$(echo "$theplanchesinnode" | awk -F'|' '{print $14}')
Thebottom_right4326=$(echo "$theplanchesinnode" | awk -F'|' '{print $15}')
Thetop_right4326=$(echo "$theplanchesinnode" | awk -F'|' '{print $16}')
Thetop_left27561=$(echo "$theplanchesinnode" | awk -F'|' '{print $5}')
Thebottom_left27561=$(echo "$theplanchesinnode" | awk -F'|' '{print $6}')
Thebottom_right27561=$(echo "$theplanchesinnode" | awk -F'|' '{print $7}')
Thetop_right27561=$(echo "$theplanchesinnode" | awk -F'|' '{print $8}')
Thetop_left=$(echo "$theplanchesinnode" | awk -F'|' '{print $9}')
Thebottom_left=$(echo "$theplanchesinnode" | awk -F'|' '{print $10}')
Thebottom_right=$(echo "$theplanchesinnode" | awk -F'|' '{print $11}')
Thetop_right=$(echo "$theplanchesinnode" | awk -F'|' '{print $12}')
ShortTifName=$(echo "$theplanchesinnode" |awk -F'|' '{print $19}' | awk -F' - ' '{print $1, $2, $4, $5}')
TheHTTPTiffsLink=$(echo "$theplanchesinnode"|awk -F'|' '{print $18}' |awk -F'_Output_3857' '{print "/system/files/Raw_map_EPSG_3857"$2}')
TheZipLink=$(echo "$theplanchesinnode" |awk -F'|' '{print $26}'|awk -F'_Output_wld_zip' '{print "/system/files/Raw_map_EPSG_3857_zip_wld"$2}')
ThePngPreview=$(echo "$TheHTTPTiffsLink" |sed 's/Raw_map_EPSG_3857/Raw_map_EPSG_3857_png_preview/g'|sed 's/\.tif/\.png/g')
echo $orange$TheHTTPTiffsLink
TheGeoserverFileName=$(echo "$theplanchesinnode" |awk -F'|' '{print $1}'| sed 's/\.tif//g'|sed "s/'/\\'/g")
TheWorkspace=$(echo "$theplanchesinnode" |awk -F'|' '{print $25}')
TheWorkspaceClassJsCss=$(echo "$theplanchesinnode" |awk -F'|' '{print $25}'|tr '-' '_' | awk '{print tolower($0)}'| sed 's/.tif//g'|tr ' ' '_')
ShortTitleHeader=$(echo "$theplanchesinnode" |awk -F'|' '{print $41}')
TheEmprise=$(echo "$theplanchesinnode" |awk -F'|' '{print $24}'| sed 's/Polygon /GEOMETRYCOLLECTION(POLYGON/g'|sed 's/))/)))/g')
echo $white$TheEmprise
TheMachineName=$(echo "$theplanchesinnode"|awk -F'|' '{print $1}'|tr '-' '_' | awk '{print tolower($0)}'| sed 's/.tif//g'|tr ' ' '_')
S18_Original_Tiff_Sources=$(echo "$theplanchesinnode"|awk -F'|' '{print $18}')
TheYear=$(echo "$theplanchesinnode"|awk -F'|' '{print $22}')
S41TheHumaneReadable=$(echo "$theplanchesinnode" |awk -F'|' '{print $41}')
echo $lightblue$S18_Original_Tiff_Sources
echo $S68_SourcePNG
DoubleQuote=$(echo \")
QUOTE="'"
echo "<div class="$QUOTE"btn-group $TheWorkspaceClassJsCss btn-group-xs"$QUOTE" year="$QUOTE"$TheYear"$QUOTE">
<div class="$QUOTE"btn btn-dark btn-xs geometry layer-selected"$QUOTE" data-toggle="$QUOTE"popover"$QUOTE" data-original-title="$QUOTE"$ShortTitleHeader"$QUOTE" data-placement="$QUOTE"left"$QUOTE" data-content="$QUOTE"$TheEmprise"$QUOTE"><div class="$QUOTE"position"$QUOTE">$TheEmprise</div>Emprise</div>
<div class="$QUOTE"btn btn-dark btn-xs geometry corners"$QUOTE">
<div class="$DoubleQuote"tpl"$DoubleQuote">
<div class="$DoubleQuote"loc-wkt"$DoubleQuote">
<div class="$DoubleQuote"position"$DoubleQuote">GEOMETRYCOLLECTION(POINT("$Thetop_left"))</div><span class=$DoubleQuote"zoominfo$DoubleQuote">18</span>
<span class="$DoubleQuote"philicon-cible-UlLt"$DoubleQuote" data-toggle="$QUOTE"popover"$QUOTE" data-original-title="$QUOTE"Top left EPSG:3857"$QUOTE" data-content="$QUOTE"<div class="$DoubleQuote"epsg-3857"$DoubleQuote">$Thetop_left</div><div class="$DoubleQuote"epsg-4326"$DoubleQuote">EPSG:4326 $Thetop_left4326</div><div class="$DoubleQuote"epsg-27571"$DoubleQuote">EPSG:27561 $Thetop_left27561</div>"$QUOTE"></span>
</div>
</div>
<div class="$DoubleQuote"tprght"$DoubleQuote">
<div class="$DoubleQuote"loc-wkt"$DoubleQuote">
<div class="$DoubleQuote"position"$DoubleQuote">GEOMETRYCOLLECTION(POINT("$Thetop_right"))</div><span class=$DoubleQuote"zoominfo$DoubleQuote">18</span>
<span class="$DoubleQuote"philicon-cible-UlLt"$DoubleQuote" data-toggle="$QUOTE"popover"$QUOTE" data-original-title="$QUOTE"Top right EPSG:3857"$QUOTE" data-content="$QUOTE"<div class="$DoubleQuote"epsg-3857"$DoubleQuote">$Thetop_right</div><div class="$DoubleQuote"epsg-4326"$DoubleQuote">EPSG:4326 $Thetop_right4326</div><div class="$DoubleQuote"epsg-27571"$DoubleQuote">EPSG:27561 $Thetop_right27561</div>"$QUOTE"></span>
</div>
</div>
<div class="$DoubleQuote"coin"$DoubleQuote">Corners</div>
<div class="$DoubleQuote"btmlft"$DoubleQuote">
<div class="$DoubleQuote"loc-wkt"$DoubleQuote">
<div class="$DoubleQuote"position"$DoubleQuote">GEOMETRYCOLLECTION(POINT("$Thebottom_left"))</div><span class=$DoubleQuote"zoominfo$DoubleQuote">18</span>
<span class="$DoubleQuote"philicon-cible-UlLt"$DoubleQuote" data-toggle="$QUOTE"popover"$QUOTE" data-original-title="$QUOTE"Bottom left EPSG:3857"$QUOTE" data-content="$QUOTE"<div class="$DoubleQuote"epsg-3857"$DoubleQuote">$Thetop_right</div><div class="$DoubleQuote"epsg-4326"$DoubleQuote">EPSG:4326 $Thebottom_left4326</div><div class="$DoubleQuote"epsg-27571"$DoubleQuote">EPSG:27561 $Thebottom_left27561</div>"$QUOTE"></span>
</div>
</div>
<div class="$DoubleQuote"btmrght"$DoubleQuote">
<div class="$DoubleQuote"loc-wkt"$DoubleQuote">
<div class="$DoubleQuote"position"$DoubleQuote">GEOMETRYCOLLECTION(POINT("$Thebottom_right"))</div><span class=$DoubleQuote"zoominfo$DoubleQuote">18</span>
<span class="$DoubleQuote"philicon-cible-UlLt"$DoubleQuote" data-toggle="$QUOTE"popover"$QUOTE" data-original-title="$QUOTE"Bottom right EPSG:3857"$QUOTE" data-content="$QUOTE"<div class="$DoubleQuote"epsg-3857"$DoubleQuote">$Thetop_right</div><div class="$DoubleQuote"epsg-4326"$DoubleQuote">EPSG:4326 $Thebottom_right4326</div><div class="$DoubleQuote"epsg-27571"$DoubleQuote">EPSG:27561 $Thebottom_right27561</div>"$QUOTE"></span>
</div>
</div>
</div>
<div class="$QUOTE"btn btn-dark btn-xs showlayer"$QUOTE" data-img="$QUOTE"$ThePngPreview"$QUOTE" data-original-title="$QUOTE""$ShortTitleHeader""$QUOTE" data-toggle="$QUOTE"popover"$QUOTE" layer="$QUOTE"$TheAddLayerMachineName"$QUOTE" addlayertolist="$QUOTE"$PrivatePath"$QUOTE">Voir</div>
<div class="$QUOTE"btn btn-dark btn-xs hidelayer"$QUOTE" layer="$QUOTE"$TheLayerMachineName_rm"$QUOTE" removelayerfromlist="$DoubleQuote"$PrivatePath"$DoubleQuote">Cacher</div>
<a class="$QUOTE"btn btn-dark btn-xs download-tif"$QUOTE" href="$QUOTE"$TheHTTPTiffsLink"$QUOTE" data-toggle="$QUOTE"tooltip"$QUOTE" data-original-title="$QUOTE"$The_fullname"$QUOTE">$ShortTifName<span class="$QUOTE"glyphicon glyphicon-download-alt"$QUOTE"></span></a>
<a class="$QUOTE"btn btn-dark btn-xs download-zip"$QUOTE" href="$QUOTE"$TheZipLink"$QUOTE" data-toggle="$QUOTE"tooltip"$QUOTE" data-original-title="$QUOTE"$TheZipNameTooltip"$QUOTE">$TheZipNameShort<span class="$QUOTE"glyphicon glyphicon-download-alt"$QUOTE"></span></a>
</div>" >> tmp/NewLayers/TheCureentNodeBody.csv
echo "
$white# JavScript and Html Element
# Make Hide and Seek
# Dynamic Layers (with map info)
# Make jquey
"
echo "<div class="$DoubleQuote"list-group-item $TheWorkspaceClassJsCss add-layer"$DoubleQuote" year="$DoubleQuote"$TheYear"$DoubleQuote" pathtogeotif="$QUOTE"$PrivatePath"$QUOTE" style="$DoubleQuote"display:none"$DoubleQuote" emprise="$QUOTE"$TheEmprise"$QUOTE" id="$DoubleQuote"$TheAddLayerMachineName"$DoubleQuote">$ShortTifName</div>" >> tmp/NewLayers/temp_layers_div_elements.txt
# Answer from menu line 45
if [ -f tmp/NewLayers/JSWorkspace ]
then
JSWorkspace=$(cat tmp/NewLayers/JSWorkspace)
else
JSWorkspace=$(echo "$TheWorkspace")
fi
ToReplacePath=$(echo pathtogeotif=\"$PrivatePath\"|sed 's/\//\\\//g')
echo $purple $TorReplacePath $The_LayerMachineName
echo "---> Genrating the javascript file"
# MachineNameMap_maindiv
cat ModelJS_Emprise.txt | sed "s/MachineNameMap/$The_LayerMachineName/g" | sed "s/HumanReadable_Name/$HumanReadableName/g" | sed "s/WokspaceLayerName/$JSWorkspace:$TheGeoserverFileName/g" | sed "s/TO_REPLACE_WITH_WKT/$TheEmprise/g" | sed "s/SOURCE_LAYER_CLASS/$TheWorkspace/g"| sed "s/PATH_2_GEOTIF/$ToReplacePath/g" >> tmp/NewLayers/TMPJS.js
echo "var $The_LayerMachineName = new OpenLayers.LonLat($The_CentroidPlanche)
if (mapbounds.containsLonLat($The_LayerMachineName)) {
\$(\"#add_$The_LayerMachineName\").show();" >> tmp/NewLayers/HidendSeekTMP.js
echo "} else { \$(\"#add_$The_LayerMachineName\").hide(); }" >> tmp/NewLayers/HidendSeekTMP.js
done
S40_Body=$(cat tmp/NewLayers/TheCureentNodeBody.csv|tr -d '\n')
echo "$newlayersIDs|$S2_nodetitle|$S3_field_deptf_seine|$S4_OldNum|$S17_WKT|$S19_Original_RawMapName|$THELAYERSONELINETIFF|$S40_Body|$S68_SourcePNG|$S65_The_zips_sources|$S35_NordOuestBasic|$S36_SudOuestBasic|$S37_SudEstBasic|$S38_NordEstBasic|$S27_NordOuestBasic2571|$S28_SudOuestBasic2571|$S29_SudEstBasic2571|$S30_NordEstBasic2571|$S31_NordOuestBasic4326|$S32_SudOuestBasic4326|$S33_SudEstBasic4326|$S34_NordEstBasic4326" >> tmp/NewLayers/Import2.csv.TMP
rm tmp/NewLayers/TheCureentNodeBody.csv
done
echo "S23_NodeID|S2_nodetitle|S3_field_deptf_seine|S4_OldNum|S17_WKT|S19_Original_RawMapName|S18_Original_Tiff_Sources|S40_Body|S68_SourcePNG|S65_The_zips_sources|S35_NordOuestBasic|S36_SudOuestBasic|S37_SudEstBasic|S38_NordEstBasic| S27_NordOuestBasic2571|S28_SudOuestBasic2571|S29_SudEstBasic2571|S30_NordEstBasic2571|S31_NordOuestBasic4326|S32_SudOuestBasic4326|S33_SudEstBasic4326|S34_NordEstBasic4326" > tmp/NewLayers/Import2.csv
cat tmp/NewLayers/Import2.csv.TMP >> tmp/NewLayers/Import2.csv
cp tmp/NewLayers/Import2.csv ../_2IMPORT.CSV
cat tmp/NewLayers/HidendSeekTMP.js >> tmp/NewLayers/HidendSeek.js
echo '
});
});' >> tmp/NewLayers/HidendSeek.js
cat ModelJS_HideNSeek_END.txt >> tmp/NewLayers/HidendSeek.js