QGIS – Unable to Add OCG API Features Layer

ogc-api-featuresqgis

I'm trying to add a layer in QGIS 3.22 from a local OCG API Features server. When I hit the Connect button, all the collections are listed correctly. When I select a collection and hit the Add button, the collection shows up in the Layer panel, but with an exclamation sign next to it: "Unavailable layer! Layer data source could not be found."

I just selected it from a list that was read from a data source, so I don't get what's going on.

Also, I noticed that when I hit Connect, QGIS called the landing page, /, and /collections, which is what I would expect a client to do in order to list collections. However, when I click to Add the layer, QGIS calls the landing page again, and nothing else. At this point I would expect /collections/XXX/items to be called instead.

How can I figure out what QGIS objects to?

Best Answer

Turns out QGIS doesn't like it when the API definition links to an OpenAPI document in YAML format instead of JSON. Re-reading the OpenAPI conformance class, it clearly specifies that the document should be in JSON format. My bad. Would have appreciated some sort of log or error message, though. Oh well.

Related Question