Hi, Try to run first gdalinfo "WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1"
and repeat the test then. If it works Ari may be able to tell why. -Jukka- Ari may be able to explain Lähettäjä: Carl Godkin <cgod...@gmail.com> Lähetetty: torstai 21. lokakuuta 2021 22.25 Vastaanottaja: Rahkonen Jukka (MML) <jukka.rahko...@maanmittauslaitos.fi>; gdal-dev@lists.osgeo.org Aihe: Re: [gdal-dev] gdallocationinfo + WCS question... Hi Jukka, Strangely, the command you pasted doesn't work for me, at with GDAL 3.3.1 on Windows (with quotes added appropriately): gdallocationinfo "WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=korkeusmalli__korkeusmalli" -wgs84 27 68 ERROR 1: PROJ: proj_uom_get_info_from_database: unit of measure not found Report: Location: (228000P,119567L) Band 1: ERROR 1: Returned tile does not match expected band configuration. Response has 1 bands while this dataset has 3 bands. 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. Response has 1 bands while this dataset has 3 bands. Band 2: ERROR 1: Returned tile does not match expected band configuration. Response has 1 bands while this dataset has 3 bands. 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. Response has 1 bands while this dataset has 3 bands. Band 3: ERROR 1: Returned tile does not match expected band configuration. Response has 1 bands while this dataset has 3 bands. 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. Response has 1 bands while this dataset has 3 bands. 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): gdallocationinfo "WCS:http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid" -wgs84 -122.086 42.948 Report: Location: (3498P,8465L) Band 1: ERROR 1: Returned tile does not match expected configuration. Got 4094x512 instead of 1024x512. 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. Got 4094x512 instead of 1024x512. Or, with --debug ON: gdallocationinfo "WCS:http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid" -wgs84 -122.086 42.948 --debug ON GDAL: GDALOpen(WCS:http://localhost:8080/wcs?service=WCS&version=2.0.1&coverageid=SRTM_3_arc-second_grid, this=00000228A4B2B970) succeeds as WCS. Report: Location: (3498P,8465L) Band 1: GDAL: GDAL_CACHEMAX = 6535 MB WCS: Requesting 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: Fetch(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: libcurl/7.78.0 Schannel zlib/1.2.11 libssh2/1.9.0 HTTP: GDAL was built against curl 7.77.0, but is running against 7.78.0. WCS: GDALOpenResult() on content-type: image/tiff GDAL: GDALOpen(/vsimem/wcs/00000228A4B2B970/wcsresult.dat, this=00000228A4CEEC40) succeeds as GTiff. ERROR 1: Returned tile does not match expected configuration. Got 4094x512 instead of 1024x512. GDAL: GDALClose(/vsimem/wcs/00000228A4B2B970/wcsresult.dat, this=00000228A4CEEC40) 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. Got 4094x512 instead of 1024x512. GDAL: GDALClose(C:\Users\carl\.gdal\wcs_cache\hcoMu.xml, this=00000228A4B2B970) 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. 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. Thanks a lot, carl On Thu, Oct 21, 2021 at 11:16 AM Rahkonen Jukka (MML) <jukka.rahko...@maanmittauslaitos.fi<mailto:jukka.rahko...@maanmittauslaitos.fi>> wrote: Hi, At least it seems to work with our WCS service gdallocationinfo WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1&coverage=korkeusmalli__korkeusmalli -wgs84 27 68 Report: Location: (228000P,119567L) Band 1: Value: 303.463989257812 -Jukka Rahkonen- Lähettäjä: gdal-dev <gdal-dev-boun...@lists.osgeo.org<mailto:gdal-dev-boun...@lists.osgeo.org>> Puolesta Carl Godkin Lähetetty: torstai 21. lokakuuta 2021 18.47 Vastaanottaja: gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org> Aihe: [gdal-dev] gdallocationinfo + WCS question... Hi, 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. First of all, is there a better way to get an elevation from a given lat,lon using WCS? Here's an example query using the USGS National Map server: gdallocationinfo "WCS:https://elevation.nationalmap.gov:443/arcgis/services/3DEPElevation/ImageServer/WCSServer?version=2.0.1&coverage=DEP3Elevation" -wgs84 -122.086 42.948 --debug ON This is a point in the middle of Crater Lake which I picked since it's flat and I know what to expect. 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. 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). Thanks for any help, carl
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev