Project

General

Profile

Revision 7096d2f9

Added by Jocelyn Dealande about 8 years ago

Refacto of Tiles handling and simplified a bit file naming for tiles/params.
By the way, fixes #297

THIS COMMIT BREAKS FILE LAYOUT AND REQUIRES MIGRATION (SEE BELLOW).

To migrate data :

cd tiles
find . '*.jpg' -exec rename 's/[^\/]*_(([0-9]{3}_){2}([0-9]{3}))/$1/' {} \;
rename 's/(.*\/).*\.params/$1site.params/' */*.params

View differences:

to_tiles/gen_tiles.sh
71 71

  
72 72
for ((z=$min_scale; z <= $max_scale; z++))
73 73
do
74
    fprefix=${prefix}_00$z
74
    fprefix=${prefix}00$z
75 75
    printf -v ratio %1.4lf $(echo "1 / (2^$z)" | bc -l)
76 76
    echo génération du ratio $ratio
77 77
    zwfname=$tmp_file
......
112 112
if ! $test_mode; then
113 113
## les lignes ci dessous sont destinnées à mettre des 0 en debut des numéros de ligne et de colonnes
114 114
## Il y a certainement plus simple mais là c'est du rapide et efficace.
115
    rename 's/_(\d\d)_(\d+\.jpg)$/_0$1_$2/' ${prefix}_*
116
    rename 's/_(\d)_(\d+\.jpg)$/_00$1_$2/' ${prefix}_*
117
    rename 's/_(\d+)_(\d\d)(\.jpg)$/_$1_0$2$3/' ${prefix}_*
118
    rename 's/_(\d+)_(\d)(\.jpg)$/_$1_00$2$3/' ${prefix}_*
115
    rename 's/_(\d\d)_(\d+\.jpg)$/_0$1_$2/' ${prefix}*
116
    rename 's/_(\d)_(\d+\.jpg)$/_00$1_$2/' ${prefix}*
117
    rename 's/_(\d+)_(\d\d)(\.jpg)$/_$1_0$2$3/' ${prefix}*
118
    rename 's/_(\d+)_(\d)(\.jpg)$/_$1_00$2$3/' ${prefix}*
119 119
fi

Also available in: Unified diff