def test_rasterize_existing_output(tmpdir, runner, basic_feature):

    truth = numpy.zeros(DEFAULT_SHAPE)
    truth[2:4, 2:4] = 1
    truth[4:6, 4:6] = 1

    output = str(tmpdir.join('test.tif'))
    result = runner.invoke(
        main_group, [
            'rasterize', output,
            '--dimensions', DEFAULT_SHAPE[0], DEFAULT_SHAPE[1],
            '--bounds', 0, 10, 10, 0],
        input=json.dumps(basic_feature))

    assert result.exit_code == 0
    assert os.path.exists(output)

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

    result = runner.invoke(
        main_group, [
            'rasterize', '-o', output, '--dimensions', DEFAULT_SHAPE[0],
            DEFAULT_SHAPE[1]],
        input=json.dumps(basic_feature))

    assert result.exit_code == 0

    with rasterio.open(output) as out:
        assert numpy.array_equal(truth, out.read(1, masked=False))
Delegate to gnumpy.isnan or numpy.isnan depending on the type of `x`.
dataset/ETHPy150Open mapbox/rasterio/tests/test_rio_features.py/test_rasterize_existing_output--crossover with--dataset/ETHPy150Open BRML/climin/climin/mathadapt.py/isnan