On Wed, May 20, 2009 at 6:53 PM, Sebastian Spaeth <[email protected]> wrote:
> Ævar Arnfjörð Bjarmason wrote:
>> I want to play with producing a heat map of the globe where "heat" is
>> determined by the relative size of t...@h tilesets at z12.
>>
>> I could also use the tiles themselves, but I suppose the tilesets will
>> be a better indicator of complexity. But whatever's easy.
>>
>> Could someone with access to the t...@h servers pretty please generate
>> this for me? :)
>
> 20:51 < spaetz> http://tah.openstreetmap.org/media/filesizes.bz2
> 20:52 < spaetz> result of ls --file-type -l -R > filesizes
> 20:52 < spaetz> takes some grepping, and cutting to get the raw sizes,
> but the
> info is in there.
I converted it to something better using a hacky ad-hoc script (attached):
http://u.nix.is/~avar/tile-sizes.txt.bz2
Thanks.
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dump 'dump';
use feature ':5.10';
my $in_z12 = 0;
my $in_block = 1;
my $z12_buffer = '';
my ($biggest, $smallest);
while (<>) {
# Skip up to the first z12 tileset
unless ($in_z12) {
next unless m[\./0000:$];
$in_z12 = 1;
}
unless (/^$/) {
$z12_buffer .= $_;
} else {
parse_buffer($z12_buffer);
$z12_buffer = '';
next;
}
}
say STDERR "Biggest, Smallest = $biggest, $smallest";
sub parse_buffer
{
my $buffer = shift;
my @lines = split /^/, $buffer;
my $x_str = shift @lines;
my ($x) = $x_str =~ m[^\./0*(\d+):];
# shift total
shift @lines;
while (my $line = shift @lines)
{
chomp $line;
my ($size, $name) = $line =~ /^\S+\s+\S+\s+\S+\s+\S+\s+(\d+)\s+\S+\s+\S+\s+\S+\s+(\S+)/;
if ($name !~ /^\d+_\d+$/) {
#warn "Danger $name";
next;
}
if (not defined $biggest or $size > $biggest) {
$biggest = $size;
}
if (not defined $smallest or $size < $smallest) {
$smallest = $size;
}
my ($x, $y) = $name =~ /^(\d+)_(\d+)$/;
$x = sprintf "%04d", $x;
$y = sprintf "%04d", $y;
say "$x,$y\t$size";
}
return;
}
_______________________________________________
Tilesathome mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/tilesathome