[Gdal-dev] GDAL WCS Driver

Frank Warmerdam warmerdam at pobox.com
Wed Aug 29 15:17:16 EDT 2007


Jeff Beiko wrote:
> Hello, 
> 
> I'm having problems getting the WCS functionality working in GDAL under C++. 
> Are there any good tutorials?
> 
> I have downloaded GDAL and CURL and have successfully built them and have 
> included the WCS functionality by having the following lines in nmake.opt:
> 
> # Uncomment to use libcurl (for WCS)
> CURL_DIR=C:\libcurl-7.15.1
> CURL_INC = -I$(CURL_DIR)/include 
> CURL_LIB = $(CURL_DIR)/libcurl_imp.lib
> 
> 
> I have set up my includes and lib paths in my MSVC project. I can confirm that 
> the WCS Driver is in fact being loaded; a valid object is returned from:
> 
> GDALDriverH driverIsLoaded = GDALGetDriverByName( "WCS" );
> 
> 
> However, when I try to retrieve WCS Data using a command like:
> 
> poDataset = (GDALDataset *) GDALOpen(fileName.c_str(), GA_ReadOnly);
> 
> ...Where the file contains xml similar to the xml below, I always get a null 
> pointer back and the error message:
> 
> ERROR 4: (the full xml...) does not exist in the file system, and is not 
> recognized as a supported dataset name.
> 
> <?xml version="1.0" encoding="UTF-8"?> 
> <WCS_GDAL>
> <ServiceURL>http://geodata.telascience.org/cgi-bin/mapserv_dem?</ServiceURL>
> <CoverageName>srtmplus_raw</CoverageName>
> <Timeout>75</Timeout>
> </WCS_GDAL>
> 
> I also try just passing GDALOpen the straight XML also.

Jeff,

As stated in http://www.gdal.org/frmt_wcs.html it is important that
*nothing* appear before the <WCS_GDAL> tag, including an xml version
element. I suspect that is what is messing you up.

I'd add that the srtmplus server is not running now as
geodata.telascience.org seems to be down, so I hope you aren't
testing against it.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list