[gdal-dev] C++ API for WCS: GetCapabilities and the new cache

Ari Jolma ari.jolma at gmail.com
Fri Sep 7 04:19:37 PDT 2018


Odd Ragnar Lydersen kirjoitti 07.09.2018 klo 12:57:

> Hi, I'm struggling to understand the new setup for WCS.
>
> In the documentation it says:
> - If the URL does not contain a coverage name, the driver attempts to fetch the capabilities document from the server, parse it, and show the resulting metadata to the user.
>
> How is this  done using the C++ API?

The "show the resulting metadata to the user" is assuming gdalinfo. If 
you do for instance

gdalinfo 
WCS:https://beta-karttakuva.maanmittauslaitos.fi/wcs/service/ows?version=2.0.1

,i.e., opening that URL with the WCS driver, the driver downloads the 
capabilities XML into the cache (probably $HOME/.gdal/wcs_cache/), 
parses it, and creates - into the cache - a PAMDataset metadata file. 
The latter contains the coverages as subdatasets for example.

This is the same as calling GDALOpenEx with the URL. GDALOpenEx gives 
you a GDALDataset object.

> - I would like to get the result from GetCapabilities listed, so that I can parse the result to establish what the coverage names are, for a given wcs.

The capabilities XML is in the cache but the driver has the code to 
parse it and it has parsed it.

>
> Also from the documentation:
> - Note that when the "WCS:<URL>" syntax for dataset name is used, the contents of the service description file is meant to be modified by using options
>
> Are these options set by calling the GDALOpen function like, GDALOpen("wcs: UserPwd=myPwd; HttpAuth=BASIC; ...",  GA_ReadOnly)?

The options are in the OpenOptions parameter in GDALOpenEx.

Best,

Ari

>
>> Odd-Ragnar<
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list