To start off with:

Coding in C++

Using the QT Creator

Reading from WFS Version 1.1.0

Using Gdal/OGR compiled with Xerces

I'm trying to get all of the Capabilities from a WFS. I know how to do this via a Get Request, now I'm wondering how to do this via code (C++). So far I have worked out how to get the Feature Name and Feature Element ( Countries - String , CountriesFID - INT) etc... Now through code I want to be able to get the creator of the WFS, its version, Spatial references. And well basically everything from the getRequest(GetCapabilities) into object form for use in my program.

I'm currently using the Gdal "Hidden" layer called "WFSGetCapabilities" which just returns the whole XML/GML document string form (not a list!) I would rather not have to QSplitString, I want my program to by dynamic and work out what's in any WFS and not just hard coded for one.


The simple answer here is, that you are going to be constrained by the operations provided by a WFS (GetCapabilities, DescribeFeatureType, GetFeature, and others depending on WFS version), and the response of a WFS GetCapabilities request is an XML document). So you will need to work out a strategy to parse the XML document to obtain the information you need.

I would suggest you look at XPAth to extract the information you need dynamically.

Take a look at https://stackoverflow.com/questions/5194604/should-i-use-xpath-or-just-dom which suggests libraries you could use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.