<div dir="ltr">Thanks, Ari and Jukka.<div><br></div><div>Even running gdalinfo on the WCS server ahead of gdallocationinfo does not help for either Jukka's server or the National Map server.</div><div><br></div><div>Although I tried originally on Windows 10 with GDAL 3.3.1, I have also tried all of this from an RHEL 7 system (with GDAL 3.0.2) and WSL/Ubuntu with 3.0.2.  I even tried the GDAL 2.4.4 that came bundled with MS4W and no joy there either.</div><div><br></div><div>I am pretty puzzled by this behavior.  Most of the time I install GDAL with "conda install gdal" but I can't believe I'm getting a broken version of GDAL there.  Oh, and the RHEL 7 system is elsewhere, so it's not some weird filtering on my computer's connection as far as I can tell.</div><div><br></div><div>Thanks for the help,</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 12:32 PM 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_5863080295126505708WordSection1">
<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">Try to run first<br>
gdalinfo "WCS:<a href="https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1" target="_blank">https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1</a>"<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">and repeat the test then. If it works Ari may be able to tell why.<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-<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"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Ari may be able to explain
<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> Carl Godkin <<a href="mailto:cgodkin@gmail.com" target="_blank">cgodkin@gmail.com</a>> <br>
<b>Lähetetty:</b> torstai 21. lokakuuta 2021 22.25<br>
<b>Vastaanottaja:</b> Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>>; <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> Re: [gdal-dev] gdallocationinfo + WCS question...<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Jukka,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Strangely, the command you pasted doesn't work for me, at with GDAL 3.3.1 on Windows (with quotes added appropriately):<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",serif">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<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.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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):<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",serif">gdallocationinfo "WCS:<a href="http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid" target="_blank">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.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Or, with --debug ON: <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",serif">gdallocationinfo "WCS:<a href="http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid" target="_blank">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" target="_blank">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" target="_blank">
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" target="_blank">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)</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks a lot,<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>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, Oct 21, 2021 at 11:16 AM Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></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</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Report:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">  Location: (228000P,119567L)</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">  Band 1:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">    Value: 303.463989257812</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></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",serif">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>
</div>
</div>

</blockquote></div>