def test_output_single_gtiff_overviews(output_single_gtiff):
    with mapchete.open(dict(output_single_gtiff.dict, output=dict(output_single_gtiff.dict['output'], overviews=True, overviews_resampling='bilinear'))) as mp:
        tile_id = (5, 3, 7)
        process_tile = mp.config.process_pyramid.tile(*tile_id)
        mp.batch_process(tile=process_tile.id)
    with rasterio.open(mp.config.output.path) as src:
        assert src.overviews(1)
        assert (src.tags().get('OVR_RESAMPLING_ALG').lower() == 'bilinear')
        for o in [1, 2, 4, 8]:
            a = src.read(masked=True, out_shape=(1, int((src.height / o)), int((src.width / o))))
            assert (not a.mask.all())
def test_output_single_gtiff_overviews(output_single_gtiff):
    with mapchete.open(dict(output_single_gtiff.dict, output=dict(output_single_gtiff.dict['output'], overviews=True, overviews_resampling='bilinear'))) as mp:
        tile_id = (5, 3, 7)
        process_tile = mp.config.process_pyramid.tile(*tile_id)
        mp.batch_process(tile=process_tile.id)
    with rasterio.open(mp.config.output.path) as src:
        assert src.overviews(1)
        assert (src.tags().get('OVR_RESAMPLING_ALG').lower() == 'bilinear')
        for o in [1, 2, 4, 8]:
            a = src.read(masked=True, out_shape=(1, int((src.height / o)), int((src.width / o))))
            assert (not a.mask.all())