I'm using a WFS that is openly available as a demo from the MapServer web site.
http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities
And now I want to make a client application that can consume this service in C++ (QT) using the GDAL libraries.
I have compiled GDAL with Xerces and curl as the docs say but apart from that they are not very clear about how to use it for a WFS, I'm sure the functionality is there because it says it supports it but I can't find any WFS specific documentation, so far I have just tried to open a connection and get this error:
GDALAllRegister();
const char *pszFilename = NULL;
pszFilename = "http://demo.mapserver.org/cgi-bin/wfs?";
m_dataset = (GDALDataset*) GDALOpen(pszFilename, GA_ReadOnly);
if( m_dataset == NULL )
{
std::cout << "Dataset is empty" << std::endl;
exit( 1 );
}
Error:
ERROR 4: `/vsimem/http_1/file.dat' not recognised as a supported file format.
Dataset is empty
ERROR 4: Failed to create temporary file:/tmp/file.dat
I have also tried instead of the URL, an XML document that contains the URL like the docs say this should work.
<OGRWFSDataSource>
<URL>http://path/to/WFS/service[?OPTIONAL_PARAMETER1=VALUE[&OPTIONNAL_PARAMETER2=VALUE]]</URL>
</OGRWFSDataSource>
But this just says the file isn't a compatible type, any help would be appreciated here.