anchor.diff:  
   -include("global_grid.hrl").
   
  +
  +-ifdef(TEST).
  +-include_lib("eunit/include/eunit.hrl").
  +%% export for eunit
  +-export([
  +         calc_tiles_enclosure/0
  +        ]).
  +-endif.
  +
   %% API
  --export([
  -         calc_tiles_enclosure/0,
  +-export([scan_img/0,
            copyout_tile_for/3
           ]).
  +
  +-record(tile_position, {current_tile_x :: integer(), 
  +                        current_tile_y :: integer(), 
  +                        tile_zoom      :: byte(),
  +                        tile_enclosure :: global_grid:encluse()}).
  +
  +scan_img() ->
  +    {TileZoom, TileEnclosure} = calc_tiles_enclosure(),
  +    {StartTileX, StartTileY, _, _} = TileEnclosure,
  +    {continue, {StartTileX, StartTileY, TileZoom},
  +               fun() ->
  +                    scan_img(
  +                             #tile_position{current_tile_x = StartTileX, 
  +                                            current_tile_y = StartTileY, 
  +                                            tile_zoom      = TileZoom,
  +                                            tile_enclosure = TileEnclosure})
  +               end}.
   
   -spec copyout_tile_for(integer(), integer(), byte()) -> 
       {ok, reference()} | {error, string()}.
  
positive.code:     gdal_nif:copyout_tile(RasterImg, Rb, Wb).
  
  
  %% @doc calculate the tiles enclosure of the img Raster in a specified zoom level
  %% the zoom level is dicided by the img precision which is defined in RasterInfo
  %% and used for base_tiles of the img
  
negative.code:     SpatialEnclosure = global_grid:get_img_coordinates_enclosure(RasterInfo),
      TileEnclosure = global_grid:calc_tminmax(ProfileMod, SpatialEnclosure, Tmaxz),
      {Tmaxz, TileEnclosure}.
  
  %% @doc Get the minimal and maximal zoom level
  %% minimal zoom level: map covers area equivalent to one tile
  