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

2021-10-25 Thread Even Rouault

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=2.0.1=GetCapabilities 



DescribeCoverage:

https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?service=WCS=2.0.1=DescribeCoverage=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=2.0.1=GetCoverage=ortokuva__ortokuva=E(393450,393650)=N(7495450,7495650)=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=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=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:


…

E,N

61254.6580619824,6623749.72946716

735433.573091962,7782000.0

i,j

,,

0

image/tiff

…

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=ortokuva__ortokuva; 
scaled.tiff


I am using GDAL version is 3.4.0dev from yesterday.

-Jukka Rahkonen-


___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


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

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


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

2021-10-25 Thread Rahkonen Jukka (MML)
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=2.0.1=GetCapabilities
DescribeCoverage:
https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?service=WCS=2.0.1=DescribeCoverage=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=2.0.1=GetCoverage=ortokuva__ortokuva=E(393450,393650)=N(7495450,7495650)=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=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=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:
...
E,N
  61254.6580619824,6623749.72946716
  735433.573091962,7782000.0
  i,j
  ,,
  0
  image/tiff
...
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=ortokuva__ortokuva;
 scaled.tiff

I am using GDAL version is 3.4.0dev from yesterday.

-Jukka Rahkonen-

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev