[gdal-dev] WCS C++ API on Windows: Fails to create VSIFILE

Odd Ragnar Lydersen Odd-Ragnar.Lydersen at powel.no
Tue Oct 9 22:58:48 PDT 2018


1) DescribeCoverage for version 1.0.0 (It's working fine if I use version=1.1.x)
********************************
static std::string wcsDescribeCoverage = "WCS:https://wms.geonorge.no/skwms1/wcs.hoyde-dtm1_32?SERVICE=WCS&REQUEST=DescribeCoverage&Coverage=dtm1_32&VERSION=1.0.0";

static const char* pOptionOpenOptions[] = { "CACHE=.\\testCache", "CoverageName=dtm1_32", "Timeout=90", nullptr };
CPLSetConfigOption("GDAL_DATA", "path/toGDAL/data");
GDALAllRegister();

GDALDatasetUniquePtr poDS1(GDALDataset::Open(wcsGetCapabilites.c_str(), GDAL_OF_READONLY, nullptr, pOptionOpenOptions, nullptr));
  if (poDS1 == nullptr)
  {
    printf("Open failed.\n");
    exit(1);
  }
********************************

2) Trying to use GDALTranslate() to get output file
********************************
char **argList; // Is filled with { "-projwin", "347500.00", "6469590.00", "351000.00", "6468000.00", "-oo", "CoverageName=dtm1_32", "-of", "XYZ", nullptr}

  GDALTranslateOptions *TranslateOptions = GDALTranslateOptionsNew(argList, NULL);
  GDALDatasetH hOutputDataset = GDALTranslate("./test.xyz", GDALDataset::ToHandle(poDS1.get()), TranslateOptions, NULL);

********************************

In both cases, I end up in WCSDataset::GDALOpenResult () function, failing to create the VSIFILE.
Is this a Windows problem?
Is there any way around it?

>Odd-Ragnar<


More information about the gdal-dev mailing list