<div dir="ltr">Hi Jukka,<div><br></div><div>Strangely, the command you pasted doesn't work for me, at with GDAL 3.3.1 on Windows (with quotes added appropriately):</div><div><br></div><div><font face="monospace">gdallocationinfo "WCS:<a href="https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=korkeusmalli__korkeusmalli">https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=korkeusmalli__korkeusmalli</a>" -wgs84 27 68<br>ERROR 1: PROJ: proj_uom_get_info_from_database: unit of measure not found<br>Report:<br> Location: (228000P,119567L)<br> Band 1:<br>ERROR 1: Returned tile does not match expected band configuration.<br>Response has 1 bands while this dataset has 3 bands.<br><br>ERROR 1: C:\Users\carl\.gdal\wcs_cache\nhXWS.xml, band 1: IReadBlock failed at X offset 222, Y offset 233: Returned tile does not match expected band configuration.<br>Response has 1 bands while this dataset has 3 bands.<br><br> Band 2:<br>ERROR 1: Returned tile does not match expected band configuration.<br>Response has 1 bands while this dataset has 3 bands.<br><br>ERROR 1: C:\Users\carl\.gdal\wcs_cache\nhXWS.xml, band 2: IReadBlock failed at X offset 222, Y offset 233: Returned tile does not match expected band configuration.<br>Response has 1 bands while this dataset has 3 bands.<br><br> Band 3:<br>ERROR 1: Returned tile does not match expected band configuration.<br>Response has 1 bands while this dataset has 3 bands.<br><br>ERROR 1: C:\Users\carl\.gdal\wcs_cache\nhXWS.xml, band 3: IReadBlock failed at X offset 222, Y offset 233: Returned tile does not match expected band configuration.<br>Response has 1 bands while this dataset has 3 bands.</font><br></div><div><br></div><div>I find that somewhat reassuring since I get a similar error when querying my own WCS server (that you helped me set up over the past couple of days):</div><div><br></div><div><font face="monospace">gdallocationinfo "WCS:<a href="http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid">http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid</a>" -wgs84 -122.086 42.948<br>Report:<br> Location: (3498P,8465L)<br> Band 1:<br>ERROR 1: Returned tile does not match expected configuration.<br>Got 4094x512 instead of 1024x512.<br>ERROR 1: C:\Users\carl\.gdal\wcs_cache\hcoMu.xml, band 1: IReadBlock failed at X offset 3, Y offset 16: Returned tile does not match expected configuration.<br>Got 4094x512 instead of 1024x512.</font><br></div><div><br></div><div>Or, with --debug ON: </div><div><br></div><div><font face="monospace">gdallocationinfo "WCS:<a href="http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid">http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid</a>" -wgs84 -122.086 42.948 --debug ON<br>GDAL: GDALOpen(WCS:<a href="http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid">http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid</a>, this=00000228A4B2B970) succeeds as WCS.<br>Report:<br> Location: (3498P,8465L)<br> Band 1:<br>GDAL: GDAL_CACHEMAX = 6535 MB<br>WCS: Requesting <a href="http://localhost:8080/wcs?service=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=SRTM_3_arc-second_grid&SUBSET=long%28-125,-121.5880315%29&SUBSET=lat%2842.749567499999998,43.176063499999998%29&Format=image/tiff">http://localhost:8080/wcs?service=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=SRTM_3_arc-second_grid&SUBSET=long%28-125,-121.5880315%29&SUBSET=lat%2842.749567499999998,43.176063499999998%29&Format=image/tiff</a><br>HTTP: Fetch(<a href="http://localhost:8080/wcs?service=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=SRTM_3_arc-second_grid&SUBSET=long%28-125,-121.5880315%29&SUBSET=lat%2842.749567499999998,43.176063499999998%29&Format=image/tiff">http://localhost:8080/wcs?service=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=SRTM_3_arc-second_grid&SUBSET=long%28-125,-121.5880315%29&SUBSET=lat%2842.749567499999998,43.176063499999998%29&Format=image/tiff</a>)<br>HTTP: libcurl/7.78.0 Schannel zlib/1.2.11 libssh2/1.9.0<br>HTTP: GDAL was built against curl 7.77.0, but is running against 7.78.0.<br>WCS: GDALOpenResult() on content-type: image/tiff<br>GDAL: GDALOpen(/vsimem/wcs/00000228A4B2B970/wcsresult.dat, this=00000228A4CEEC40) succeeds as GTiff.<br>ERROR 1: Returned tile does not match expected configuration.<br>Got 4094x512 instead of 1024x512.<br>GDAL: GDALClose(/vsimem/wcs/00000228A4B2B970/wcsresult.dat, this=00000228A4CEEC40)<br>ERROR 1: C:\Users\carl\.gdal\wcs_cache\hcoMu.xml, band 1: IReadBlock failed at X offset 3, Y offset 16: Returned tile does not match expected configuration.<br>Got 4094x512 instead of 1024x512.<br>GDAL: GDALClose(C:\Users\carl\.gdal\wcs_cache\hcoMu.xml, this=00000228A4B2B970)</font><br></div><div><br></div><div>Any suggestions? If I break the above debug output down and use "curl" to download the GeoTIFF and then use gdallocationinfo on the downloaded file, I get a reasonable result.</div><div>I guess I could do that. But what I find very strange is that gdallocationinfo seems to request a rather odd-shaped patch (-125 to -121.5 in longitude, but only 42.75 to 43.18 in latitude) which cases trouble.</div><div><br></div><div>Thanks a lot,</div><div><br></div><div>carl</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 21, 2021 at 11:16 AM Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="FI" style="overflow-wrap: break-word;">
<div class="gmail-m_7080187580823148945WordSection1">
<p class="MsoNormal"><span>Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">At least it seems to work with our WCS service<br>
<br>
gdallocationinfo WCS:<a href="https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=korkeusmalli__korkeusmalli" target="_blank">https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=korkeusmalli__korkeusmalli</a>
-wgs84 27 68<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Report:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> Location: (228000P,119567L)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> Band 1:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"> Value: 303.463989257812<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Carl Godkin<br>
<b>Lähetetty:</b> torstai 21. lokakuuta 2021 18.47<br>
<b>Vastaanottaja:</b> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> [gdal-dev] gdallocationinfo + WCS question...<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I am trying to use gdallocationinfo to query point locations from a WCS server and not having any luck. I don't see anything in the docs that says this is unsupported but I can't make it work.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">First of all, is there a better way to get an elevation from a given lat,lon using WCS?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Here's an example query using the USGS National Map server:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"Courier New"">gdallocationinfo "WCS:<a href="https://elevation.nationalmap.gov:443/arcgis/services/3DEPElevation/ImageServer/WCSServer?version=2.0.1&coverage=DEP3Elevation" target="_blank">https://elevation.nationalmap.gov:443/arcgis/services/3DEPElevation/ImageServer/WCSServer?version=2.0.1&coverage=DEP3Elevation</a>"
-wgs84 -122.086 42.948 --debug ON</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">This is a point in the middle of Crater Lake which I picked since it's flat and I know what to expect.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Anyway, looking at the debug output it appears that the program is querying for a GeoTIFF of a VERY large area and that's failing.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I actually want to do this with my own WCS server but thought it might be mis-configured somehow so I tried the USGS server. With my own server, gdallocationinfo seems to be requesting a strange shape from the server (as I can see through
the debug output).<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks for any help,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">carl<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</blockquote></div>