Hi, source grid filename with spaces not working when calling grdcut
on a geotiff. The internal gdal_translate
receives filename not quoted so spaces in the file name cause an error. Extract from the debug output below.
Calling gdal_translate
instead directly with filenames surrounded by quotes works.
Problematic filename in my case is:
"Canadian Hydrographic Service NONNA bathymetry/NONNAP_9_TIFF/TIFF/NONNAP10_4400N06400W.tiff"
I think this may be a bug in filename handling.
Relevant debug output from grdcut
:
grdcut [INFORMATION]: The gdal_translate command:
gdal_translate -projwin -63.6834 44.7334 -63.6 44.65 -of netCDF -co COMPRESS=DEFLATE -co FORMAT=NC4 -co ZLEVEL=3 -a_nodata NaN Canadian Hydrographic Service NONNA bathymetry/NONNAP_9_TIFF/TIFF/NONNAP10_4400N06400W.tiff BB_Bathymetry.nc
ERROR 6: Too many command options 'Service'
Usage: gdal_translate [--help-general] [--long-usage]
[-ot {Byte/Int16/UInt16/UInt32/Int32/UInt64/Int64/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-strict]
[-if format]* [-of format]
[-b band] [-mask band] [-expand {gray|rgb|rgba}]
[-outsize xsize[%]|0 ysize[%]|0] [-tr xres yres]
[-r {nearest,bilinear,cubic,cubicspline,lanczos,average,mode}]
[-unscale] [-scale[_bn] [src_min src_max [dst_min dst_max]]]* [-exponent[_bn] exp_val]*
[-srcwin xoff yoff xsize ysize] [-epo] [-eco]
[-projwin ulx uly lrx lry] [-projwin_srs srs_def]
[-a_srs srs_def] [-a_coord_epoch epoch]
[-a_ullr ulx uly lrx lry] [-a_nodata value]
[-a_scale value] [-a_offset value]
[-nogcp] [-gcp pixel line easting northing [elevation]]*
|-colorinterp{_bn} {red|green|blue|alpha|gray|undefined}]
|-colorinterp {red|green|blue|alpha|gray|undefined},...]
[-mo "META-TAG=VALUE"]* [-q] [-sds]
[-co "NAME=VALUE"]* [-stats] [-norat] [-noxmp]
[-oo NAME=VALUE]*
src_dataset dst_dataset
grdcut [ERROR]: Error calling gdal_translate -projwin -63.6834 44.7334 -63.6 44.65 -of netCDF -co COMPRESS=DEFLATE -co FORMAT=NC4 -co ZLEVEL=3 -a_nodata NaN Canadian Hydrographic Service NONNA bathymetry/NONNAP_9_TIFF/TIFF/NONNAP10_4400N06400W.tiff BB_Bathymetry.ncgrdcut [DEBUG]: gmtlib_garbage_collection: Destroying object: C=0 A=0 ID=1 W=Input F=Image M=File S=Unused P=55f21ca0d2b0 N=Canadian Hydrographic Service NONNA bathymetry/NONNAP_9_TIFF/TIFF/NONNAP10_4400N06400W.tiff