I agree with XaskeL, clusters are the most efficient way of doing this.
@Hydra
Feel free to use this cluster library, which I am using for the airplane resource. Or find another library if the cells are too large, there should be more available. (this is size 31x31)
local sourceMap = Cluster:new()
--[[
SET
]]
local cell = sourceMap:getCellFromWorldMap( x, y )
if cell then
cell:setData( "key", "<mixing>" )
end
--[[
GET using position
]]
local centerCell = sourceMap:getCellFromWorldMap( x, y )
local cellCollection = sourceMap:getCellsBetweenCells( sourceMap:getCellFromSourceMap( centerCell.x - 1, centerCell.y - 1 ),
sourceMap:getCellFromSourceMap( centerCell.x + 1, centerCell.y + 1 ) )
-- 9 cells returned (but can be less)
-- LOOP: cellCollection
cell:getData( "key" )
--