convert_regions_to_grid function

Convert regions to a grid