def test_write_geotiff_tags(mp_tmpdir, cleantopo_br, write_rasterfile_tags_py):
    'Pass on metadata tags from user process to rasterio.'
    conf = dict(**cleantopo_br.dict)
    conf.update(process=write_rasterfile_tags_py)
    with mapchete.open(conf) as mp:
        for tile in mp.get_process_tiles():
            (data, tags) = mp.execute(tile)
            assert data.any()
            assert isinstance(tags, dict)
            mp.write(process_tile=tile, data=(data, tags))
            out_path = mp.config.output.get_path(tile)
            with rasterio.open(out_path) as src:
                assert ('filewide_tag' in src.tags())
                assert (src.tags()['filewide_tag'] == 'value')
                assert ('band_tag' in src.tags(1))
                assert (src.tags(1)['band_tag'] == 'True')
Pass on metadata tags from user process to rasterio.
def test_write_geotiff_tags(mp_tmpdir, cleantopo_br, write_rasterfile_tags_py):
    
    conf = dict(**cleantopo_br.dict)
    conf.update(process=write_rasterfile_tags_py)
    with mapchete.open(conf) as mp:
        for tile in mp.get_process_tiles():
            (data, tags) = mp.execute(tile)
            assert data.any()
            assert isinstance(tags, dict)
            mp.write(process_tile=tile, data=(data, tags))
            out_path = mp.config.output.get_path(tile)
            with rasterio.open(out_path) as src:
                assert ('filewide_tag' in src.tags())
                assert (src.tags()['filewide_tag'] == 'value')
                assert ('band_tag' in src.tags(1))
                assert (src.tags(1)['band_tag'] == 'True')