9 |
use File::Find; |
use File::Find; |
10 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
11 |
use Imager; |
use Imager; |
12 |
|
use Getopt::Long; |
13 |
|
|
14 |
|
# Mireo 1, Google 0 |
15 |
|
my $flip_vertical = 0; |
16 |
|
|
17 |
|
GetOptions( |
18 |
|
'flip-vertical' => \$flip_vertical, |
19 |
|
); |
20 |
|
|
21 |
my $path = shift @ARGV || die "usage: $0 path_to_dump_dir\n"; |
my $path = shift @ARGV || die "usage: $0 path_to_dump_dir\n"; |
22 |
|
|
110 |
|
|
111 |
# this is specific to globe position, I guess ... this is europe |
# this is specific to globe position, I guess ... this is europe |
112 |
my $x = ( $file_pos->{$tile_file}->{x} - $range->{min}->{x} ) / $step->{x}; |
my $x = ( $file_pos->{$tile_file}->{x} - $range->{min}->{x} ) / $step->{x}; |
113 |
my $y = ( $range->{max}->{y} - $file_pos->{$tile_file}->{y} ) / $step->{y}; |
my $y; |
114 |
|
if ( $flip_vertical ) { |
115 |
|
$y = ( $range->{max}->{y} - $file_pos->{$tile_file}->{y} ) / $step->{y}; |
116 |
|
} else { |
117 |
|
$y = ( $file_pos->{$tile_file}->{y} - $range->{min}->{y} ) / $step->{y}; |
118 |
|
} |
119 |
|
|
120 |
printf("%3dx%-3d %s\n", $x, $y, $tile_file); |
printf("%3dx%-3d %s\n", $x, $y, $tile_file); |
121 |
|
|