OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.77k stars 2.5k forks source link

WCS: creation option get passed to server #1400

Open tobwen opened 5 years ago

tobwen commented 5 years ago

Expected behavior and actual behavior.

As a user, I want to create a tiled GeoTIFF using gdal_translate using -co TILED=YES.

gdal_translate --debug on --config GDAL_HTTP_UNSAFESSL YES "WCS:https://monitor.ioer.de/cgi-bin/wcs?map=V01RG_wcs&REQUEST=GetCoverage&COVERAGE=V01RG_2017_100m" -oo OriginAtBoundary -a_nodata -9998 -co TILED=YES -co COMPRESS=LZW -of GTiff V01RG_2017_100m.tif
GDAL: GDALOpen(WCS:https://monitor.ioer.de/cgi-bin/wcs?map=V01RG_wcs&REQUEST=GetCoverage&COVERAGE=V01RG_2017_100m, this=0000000000455670) succeeds as WCS.
GDAL: QuietDelete(V01RG_2017_100m.tif) invoking Delete()
GDAL: GDALOpen(V01RG_2017_100m.tif, this=00000000025CC160) succeeds as GTiff.
GDAL: GDALDefaultOverviews::OverviewScan()
GDAL: GDALClose(V01RG_2017_100m.tif, this=00000000025CC160)
Input file size is 7000, 9500
0GDAL: GDAL_CACHEMAX = 614 MB
GDAL: GDALDatasetCopyWholeRaster(): 7000*256 swaths, bInterleave=0
WCS: DirectRasterIO(0,0,7000,256) -> (7000,256) (1 bands)

WCS: Requesting https://monitor.ioer.de/cgi-bin/wcs?SERVICE=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=V01RG_2017_100m&SUBSET=x%284000000,4700000%29&SUBSET=y%283574400,3600000%29&Format=image/tiff&GEOTIFF:TILING=TRUE&map=V01RG_wcs
HTTP: Fetch(https://monitor.ioer.de/cgi-bin/wcs?SERVICE=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=V01RG_2017_100m&SUBSET=x%284000000,4700000%29&SUBSET=y%283574400,3600000%29&Format=image/tiff&GEOTIFF:TILING=TRUE&map=V01RG_wcs)
HTTP: libcurl/7.60.0 OpenSSL/1.0.2j zlib/1.2.8 WinIDN
WCS: GDALOpenResult() on content-type: image/tiff
GDAL: GDALOpen(/vsimem/wcs/0000000000455670/wcsresult.dat, this=0000000002828750) succeeds as GTiff.
GDAL: GDALClose(/vsimem/wcs/0000000000455670/wcsresult.dat, this=0000000002828750)
.WCS: DirectRasterIO(0,256,7000,256) -> (7000,256) (1 bands)

As you can see, the request for tiles get passed through to the server. This is unexpected, since -co TILED=YES is a creation option for of GTiff and not an open option.

Steps to reproduce the problem.

gdal_translate --debug ON --config GDAL_HTTP_UNSAFESSL YES "WCS:https://monitor.ioer.de/cgi-bin/wcs?map=V01RG_wcs&REQUEST=GetCoverage&COVERAGE=V01RG_2017_100m" -oo OriginAtBoundary -a_nodata -9998 -co TILED=YES -co COMPRESS=LZW V01RG_2017_100m.tif

License of this dataset: http://www.ioer-monitor.de/fileadmin/Dokumente/PDFs/Nutzungsbedingungen_IOER-Monitor.pdf

Operating system

Windows 7, 64 bit

GDAL version and provenance

GDAL 2.5.0dev, released 2019/99/99 (latest one from OSGeo4W)

jratike80 commented 5 years ago

You should ask questions from the gdal-dev mailing and not through the issue tracker.

There may be an issue here if GDAL creates the request automatically with GEOTIFF:TILING=TRUE and the server does support GeoTIFF extension (that appears in GetCapabilities) but does not support tiling. Support for tiling is optional but as far as I know it is not possible to know it beforehand. If server does not support tiling it should send "TilingNotSupported" error as a response for the GetCoverage request. I do not know any geotiff-capable WCS 2.0 server that would not support tiling as well but such may exist.

As an administrator of a WCS server I would say that it is just good if GDAL makes tiled requests and it might well be the default behavior to try always with tiling=true first. If I remember right some servers do not have a default for the tilesize so explicit tileheight=256 and tilewidth=256 might be needed as well.

tobwen commented 5 years ago

You should ask questions from the gdal-dev mailing and not through the issue tracker.

It was not actually meant to be a question, I just put it that way. I assumed that it was a mistake. I will reformulate the report accordingly.