[gdal-dev] WCS: Unable to export GeoTIFF files with zero bands

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Mon Oct 25 13:51:39 PDT 2021


Hi,

I do not understand what could be wrong with this WCS. With direct WCS 2.0.1 requests everything works fine.

GetCapabilities:
https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?service=WCS&AcceptVersions=2.0.1&request=GetCapabilities
DescribeCoverage:
https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?service=WCS&version=2.0.1&request=DescribeCoverage&coverageID=ortokuva__ortokuva
This is listing DataRecord with three fields: red band, green band, and blue band.
GetCoverage:
https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?service=WCS&version=2.0.1&request=GetCoverage&CoverageID=ortokuva__ortokuva&SUBSET=E(393450,393650)&SUBSET=N(7495450,7495650)&format=image/tiff
This sends a tiff file.


With GDAL:
gdalinfo -oo CLEAR_CACHE "WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?"
I get the subdatasets.

gdalinfo "WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=ortokuva__ortokuva"
Looks good but I am not sure what I should expect to see.

gdal_translate -projwin 393450 7495650 393650 7495450   "WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=ortokuva__ortokuva" wcs.tif
This gives an error:
Input file size is 1348357, 2316500
ERROR 1: wcs.tif: Unable to export GeoTIFF files with zero bands.

I can indeed see at the end of the automatically generated XML file that the band count is interpreted to be zero:
...
<Domain>E,N</Domain>
  <Low>61254.6580619824,6623749.72946716</Low>
  <High>735433.573091962,7782000.0</High>
  <GridAxes>i,j</GridAxes>
  <NoDataValue>,,</NoDataValue>
  <BandCount>0</BandCount>
  <Format>image/tiff</Format>
...
I tried to edit the band count into 3 by hand, but GDAL is changing it back to zero.

The example from the WCS driver page https://gdal.org/drivers/raster/wcs.html that  is using the very same server and coverage does save an image even there is no fundamental difference in the command.
gdal_translate -oo CACHE=wcs_cache -oo CLEAR_CACHE -oo INTERLEAVE=PIXEL -projwin 377418 6683393.87938218 377717.879386966 6683094  -oo Subset="time(1985-01-01T00:00:00.000Z)" -outsize 60 0 "WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=ortokuva__ortokuva" scaled.tiff

I am using GDAL version is 3.4.0dev from yesterday.

-Jukka Rahkonen-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20211025/42c379c1/attachment.html>


More information about the gdal-dev mailing list