Hi Avar,

Ævar Arnfjörð Bjarmason wrote:
> 2009/5/31 Ævar Arnfjörð Bjarmason <[email protected]>:
>> 2009/5/21 Ævar Arnfjörð Bjarmason <[email protected]>:
>>> 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
>> I went ahead and created a renderer so it now makes a heat map, it's
>> under applications/rendering/tah-heatmap in svn:
>>
>> http://trac.openstreetmap.org/changeset/15441
>>
>> Example output here:
>>
>> http://u.nix.is/~avar/osm-heatmap.png
> 
> Using 32 times the median as the maximum value makes things somewhat better:
> 
> http://u.nix.is/~avar/osm-heatmap-black-2.png
If you apply the following patch (simple enough to hack it in manually) 
to "generate-heatmap.pl" it looks somewhat better in my point of view.
You can play around with the exponent at line 101 (which I set to 0.25), 
good values are about between 0.2 and 0.33.


Best regards

Alfons



@@ -9,6 +9,8 @@
  my $from = 0;
  my $to   = 2**12-1;

+GD::Image->trueColor(1);
+
  # Create a new image with each pixel = one z12 tile
  my $im = GD::Image->new(2**12, 2**12);

@@ -16,8 +18,8 @@
  my $white = $im->colorAllocate(255,255,255);

  # make the background transparent and interlaced
-$im->transparent($white);
-$im->interlaced('true');
+#$im->transparent($white);
+#$im->interlaced('true');

  my $file = shift;
  say STDERR "Parsing tile size file `$file'...";
@@ -95,7 +97,8 @@

      # FIXME: This results in a very lousy distribution, the map is all
      # blue
-    my $n = $size / $max;
+#    my $n = $size / $max;
+    my $n = (($size-$min+1) / $max)**0.25;

      return $n;
  }


_______________________________________________
Tilesathome mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/tilesathome

Reply via email to