15 |
my $limit = ''; |
my $limit = ''; |
16 |
$limit = '-f 1 -l 1'; |
$limit = '-f 1 -l 1'; |
17 |
|
|
18 |
|
my $tiles_path = 'tiles/basic'; |
19 |
|
rmtree $tiles_path if -d $tiles_path; |
20 |
|
mkpath $tiles_path || die "can't create $tiles_path: $!"; |
21 |
|
|
22 |
foreach my $zoom ( 1 .. 12 ) { |
foreach my $zoom ( 1 .. 12 ) { |
23 |
|
|
24 |
my $dpi = $zoom * 25; |
my $dpi = $zoom * 15; |
25 |
|
|
26 |
my $ppm = "tmp-$dpi"; |
my $ppm = "tmp-$dpi"; |
27 |
my $tmp = "$ppm-000001.ppm"; |
my $tmp = "$ppm-000001.ppm"; |
43 |
my $tiles_x = int( $x_size / 256 ); |
my $tiles_x = int( $x_size / 256 ); |
44 |
my $tiles_y = int( $y_size / 256 ); |
my $tiles_y = int( $y_size / 256 ); |
45 |
|
|
46 |
print "creating in $tiles_x*$tiles_y tiles...\n"; |
print "creating in $tiles_x*$tiles_y tiles\n"; |
47 |
|
|
48 |
for my $y ( 0 .. $tiles_y ) { |
for my $y ( 0 .. $tiles_y ) { |
49 |
for my $x ( 0 .. $tiles_x ) { |
for my $x ( 0 .. $tiles_x ) { |
69 |
} |
} |
70 |
|
|
71 |
# emulate TileCache disk layout |
# emulate TileCache disk layout |
72 |
my $path = sprintf("tiles/basic/%02d/%03d/%03d/%03d/%03d/%03d/%03d.png", |
my $path = sprintf("%s/%02d/%03d/%03d/%03d/%03d/%03d/%03d.png", |
73 |
|
$tiles_path, |
74 |
$zoom - 1, # starts with 0 |
$zoom - 1, # starts with 0 |
75 |
int( $x / 1000000 ), |
int( $x / 1000000 ), |
76 |
int( $x / 1000 ) % 1000, |
int( $x / 1000 ) % 1000, |