anchor.diff:      math_utils:xy_assert({3, 3}, pixels_to_tile(1000, 1000)),
       math_utils:xy_assert({3, 39}, pixels_to_tile(1000, 10000)).
   
  +quadtree_test() ->
  +    ?assertEqual("2222222", quadtree(0, 0, 7)),
  +    ?assertEqual("113113", quadtree(-1, -10, 6)),
  +    ?assertEqual("2221", quadtree(1, 1, 4)),
  +    ?assertEqual("22221", quadtree(1, 1, 5)).
  +
   -endif.
  
positive.code: 
  %% 
  -export([zoom_for_pixelsize/3, 
           copyout_tile_for/6,
           calc_tiles_enclosure/2,
           pixels_to_tile/2]).
  
negative.code:     pixels_to_tile(Px, Py).
  
  
  %% @doc Converts TMS tile coordinates to Microsoft QuadTree
  -spec(quadtree(TX::integer(), TY::integer(), Zoom::byte()) -> string()).
  quadtree(TX, TY, Zoom) ->
      Ty = trunc(math:pow(2, Zoom) - 1 - TY),
      quadtree(TX, Ty, Zoom, "").
  
  %% ===================================================================
  %% private functions
  %% ===================================================================
  