Function for creating tile grids from extents