52North / IlwisTests

An c++ module containing tests for Ilwis development using Qt
5 stars 3 forks source link

Writing featurecoverage as shp fails #2

Open ridoo opened 10 years ago

ridoo commented 10 years ago

How is it possible to write an IFeatureCoverage as ESRI shp file? This is what I tried (complete test code):

QDir baseDataPath = TestSuite::instance()->outputDataPath();
QUrl outputFeature = QUrl::fromLocalFile(baseDataPath.absolutePath() + "/feature.shp");
fcoverage->connectTo(outputFeature.toString(), "ESRI Shapefile", "gdal", IlwisObject::cmOUTPUT);
//fcoverage->store(); // fails!

The error message is

Could not create /.
CPL FAILURE(CPLE_AppDefined): Failed to create file .shp file.
CPL FAILURE(CPLE_OpenFailed): Failed to open Shapefile `/.\wfs?VERSION=1.1.0&REQUEST=GetFeature&typeName=ogi%3Aquad100.shp'.
Could not create layer for wfs?VERSION=1.1.0&REQUEST=GetFeature&typeName=ogi%3Aquad100
MartinSchouwenburg commented 10 years ago

seems like a very odd name for a shape file :). I suppose that in constructing the name it somewhere takes the url of the inputconnector (the WFS) in making a name. Looking at the name it tries to create a name based on the end of the input url (which should have been the output connector)