[gdal-dev] gdallocationinfo + WCS question...

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Oct 21 12:26:03 PDT 2021


Hi,

My first test was:
gdallocationinfo  "WCS:https://elevation.nationalmap.gov:443/arcgis/services/3DEPElevation/ImageServer/WCSServer?version=2.0.1&coverage=DEP3Elevation" -wgs84 10 20 --debug on

Generated request was:
WCS: Requesting https://elevation.nationalmap.gov:443/arcgis/services/3DEPElevation/ImageServer/WCSServer?SERVICE=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=DEP3Elevation&SUBSET=x%281112188.7215549201,1113212.7215446942%29&SUBSET=y%282272938.1370637044,2273450.1370585896%29&Format=image/tiff

Gdallocationfo showed:
    Value: 0

Maybe it is a right value, I do not know. I got zero value also with -wgs84 27 68. Now I tried with the coordinates that you used -wgs84 -122.086 42.948 but it leads into server error after GDAL sent this request with quite a large subsets:
WCS: Requesting https://elevation.nationalmap.gov:443/arcgis/services/3DEPElevation/ImageServer/WCSServer?SERVICE=WCS&REQUEST=GetCoverage&VERSION=2.0.1&COVERAGEID=DEP3Elevation&SUBSET=x%28-20037507.0672000013,-13590403.131594259%29&SUBSET=y%285303978.1067894027,5304490.1067842878%29&Format=image/tiff

-Jukka-





Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org> Puolesta Ari Jolma
Lähetetty: torstai 21. lokakuuta 2021 22.09
Vastaanottaja: gdal-dev at lists.osgeo.org
Aihe: Re: [gdal-dev] gdallocationinfo + WCS question...


I don't understand the problem :)

Maybe it's because I ran gdalinfo on the WCS first.

For the gdallocationinfo I get

gdallocationinfo "WCS:https://elevation.nationalmap.gov:443/arcgis/services/3DEPElevation/ImageServer/WCSServer?version=2.0.1&coverage=DEP3Elevation" -wgs84 -122.086 42.948
Report:
  Location: (6446955P,13504941L)
  Band 1:
    Value: 1882.00549316406

Ari
Rahkonen Jukka (MML) kirjoitti 21.10.2021 klo 21.56:
Hi,

I wonder if the problem is in the multipart response that the nationalmap.gov server is sending. The result is not too big tiff (1023x511 pixels as revealed by <gml:high>1023 511</gml:high>) but perhaps GDAL does not know how to extract it from the multipart envelope. I do not know either. I thought that multipart was only an issue with WCS 1.1.x but obviously it can be used also with WCS 2.0. I do understand how brilliant idea multipart response is in theory but unfortunately it is a pain for the users.

This is the beginning of the response:

--wcs
Content-Type: text/xml
Content-ID: GML-Part
  <gml:boundedBy>
    <gml:Envelope srsName=http://www.opengis.net/def/crs/EPSG/0/3857 axisLabels="x y" uomLabels=" " srsDimension="2">
      <gml:lowerCorner>3005564.702644 10446506.055425</gml:lowerCorner>
      <gml:upperCorner>3006588.702633 10447018.055420</gml:upperCorner>
    </gml:Envelope>
  </gml:boundedBy>
  <gml:domainSet>
    <gml:RectifiedGrid dimension="2" gml:id="grid_Coverage1">
      <gml:limits>
        <gml:GridEnvelope>
          <gml:low>0 0</gml:low>
          <gml:high>1023 511</gml:high>
        </gml:GridEnvelope>
      </gml:limits>
      <gml:axisLabels>band_1</gml:axisLabels>
      <gml:origin>
        <gml:Point gml:id="grid_origin_Coverage1" srsName=http://www.opengis.net/def/crs/EPSG/0/3857>
          <gml:pos>3005564.702644 10446506.055425</gml:pos>
        </gml:Point>
      </gml:origin>
      <gml:offsetVector srsName=http://www.opengis.net/def/crs/EPSG/0/3857>XOFFSET1.000000XOFFSET 0 </gml:offsetVector>
      <gml:offsetVector srsName=http://www.opengis.net/def/crs/EPSG/0/3857>0 YOFFSET1.000000YOFFSET </gml:offsetVector>
    </gml:RectifiedGrid>
  </gml:domainSet>
  <gml:rangeSet>
    <gml:File>
      <gml:rangeParameters xlink:href=cid:Coverage1.tif xlink:role=http://www.opengis.net/spec/WCS_coverageencoding_geotiff/1.0/ xlink:arcrole="fileReference"/>
      <gml:fileReference>cid:Coverage1.tif</gml:fileReference<cid:Coverage1.tif%3c/gml:fileReference>>
      <gml:fileStructure/>
      <gml:mimeType>image/tiff</gml:mimeType>
    </gml:File>
  </gml:rangeSet>
  <gmlcov:rangeType>
    <swe:DataRecord>
      <swe:field name="band_1">
        <swe:Quantity>
          <swe:description>band_1</swe:description>
          <swe:uom code="unknown"/>
          <swe:constraint>
            <swe:AllowedValues>
              <swe:interval>3.4E-38 3.4E+38</swe:interval>
            </swe:AllowedValues>
          </swe:constraint>
        </swe:Quantity>
      </swe:field>
    </swe:DataRecord>
  </gmlcov:rangeType>
</gmlcov:RectifiedGridCoverage>
--wcs
Content-Type: image/tiff
Content-Description: coverage data
Content-Transfer-Encoding: binary
Content-ID: 1.tif
…

-Jukka Rahkonen-


Lähettäjä: gdal-dev <gdal-dev-bounces at lists.osgeo.org><mailto:gdal-dev-bounces at lists.osgeo.org> Puolesta Carl Godkin
Lähetetty: torstai 21. lokakuuta 2021 18.47
Vastaanottaja: gdal-dev at lists.osgeo.org<mailto:gdal-dev at 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 at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>

https://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20211021/c85bd748/attachment-0001.html>


More information about the gdal-dev mailing list