mirror of
https://github.com/rasterio/rasterio.git
synced 2026-02-01 14:34:43 +00:00
option name change to --to-data-window
This commit is contained in:
parent
99fc409521
commit
7be425d9c3
@ -30,7 +30,7 @@ projection_projected_opt = click.option(
|
||||
help="Bounds in input's own projected coordinates (the default).")
|
||||
|
||||
data_window_options = click.option(
|
||||
'--clip-data-window',
|
||||
'--to-data-window',
|
||||
flag_value='datawindow',
|
||||
help='Clip the raster to the region of valid data by removing areas of surrounding NoData values.'
|
||||
)
|
||||
@ -140,7 +140,7 @@ def clip(
|
||||
bounds_window = get_data_window(src.read(1,masked=True))
|
||||
|
||||
else:
|
||||
raise click.UsageError('--bounds, --like, or --clip-data-window required')
|
||||
raise click.UsageError('--bounds, --like, or --to-data-window required')
|
||||
|
||||
if not with_complement:
|
||||
bounds_window = bounds_window.intersection(
|
||||
|
||||
@ -64,7 +64,7 @@ def test_clip_to_datawindow(runner,tmpdir):
|
||||
output = str(tmpdir.join('test.tif'))
|
||||
result = runner.invoke(
|
||||
main_group,
|
||||
['clip','tests/data/float_raster_with_extra_nodata.tif',output,'--clip-data-window']
|
||||
['clip','tests/data/float_raster_with_extra_nodata.tif',output,'--to-data-window']
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert os.path.exists(output)
|
||||
@ -94,7 +94,7 @@ def test_clip_missing_params(runner, tmpdir):
|
||||
result = runner.invoke(
|
||||
main_group, ['clip', 'tests/data/shade.tif', output])
|
||||
assert result.exit_code == 2
|
||||
assert '--bounds, --like, or --clip-data-window required' in result.output
|
||||
assert '--bounds, --like, or --to-data-window required' in result.output
|
||||
|
||||
|
||||
def test_clip_bounds_disjunct(runner, tmpdir):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user