def test_rasterize_like_raster_outside_bounds(tmpdir, runner, basic_feature,
                                              pixelated_image_file):

    coords = numpy.array(basic_feature['geometry']['coordinates']) + 100
    basic_feature['geometry']['coordinates'] = coords.tolist()

    output = str(tmpdir.join('test.tif'))
    result = runner.invoke(
        main_group,
        ['rasterize', output, '--like', pixelated_image_file],
        input=json.dumps(basic_feature)
    )

    assert result.exit_code == 0
    assert 'outside bounds' in result.output
    assert os.path.exists(output)
    with rasterio.open(output) as out:
        assert not numpy.any(out.read(1, masked=False))
Rasterizing a feature outside bounds of --like raster should result
dataset/ETHPy150Open mapbox/rasterio/tests/test_rio_features.py/test_rasterize_like_raster_outside_bounds