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

Even Rouault even.rouault at spatialys.com
Mon Oct 25 14:16:01 PDT 2021


Jukka,

The source code was useful to figure out why BandCount was reset to 0 in 
the cache :-) So it is related to the fact that there is an extra time 
dimension, and such extra dimensions must be specified according to 
https://gdal.org/drivers/raster/wcs.html#range-and-dimension-subsetting

Adding   -oo Subset="time(1985-12-31T00:00:00.000Z)" for example solves 
the issue

It would be nice to have some warning message though. Might be worth a 
ticket

Even

Le 25/10/2021 à 22:51, Rahkonen Jukka (MML) a écrit :
>
> 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 
> <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 
> <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 
> <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 
> <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-
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.

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


More information about the gdal-dev mailing list