qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.31k stars 2.96k forks source link

QGIS Vector/ogcapi layer unable to add features/items #58087

Open doublebyte1 opened 1 month ago

doublebyte1 commented 1 month ago

What is the bug or the crash?

The Data Source Manager-> Add Vector UI, has an option to add an "OGC API" layer. Under the hood, this is using the "OGCAPI" raster driver, which has support for (vector) tiles, but not features. In GDAL, features is supported through the OAPIAF driver. The UI is a bit misleading, because it gives the impression that you could add features (e.g.: items) from here, when that is not the case.

Screenshot from 2024-07-12 14-32-00

When trying to add a feature collection, QGIS seems to be looking for tiles.

Screenshot from 2024-07-12 14-32-14

ERROR: Status 2: File OGCAPI:https://demo.ldproxy.net/daraa/collections/AeronauticCrv/|option:API=ITEMS could not be found
Aborted (core dumped)

One option to solve this could be to remove "items" from the "API" options. Another option, would be to actually provide support for items, but in that case GDAL would need to use the OAPIAF driver, so prepend OAPIAF to the collection path, instead OGCAPI.

I am using QGIS master, built from the code base on 11/07/2024, and GDAL master built also on 11/07/2024.

Steps to reproduce the issue

Add OGC API layer, through the add vector layer menu and select "ogc api". Then add this url:

https://demo.ldproxy.net/daraa/collections/AeronauticCrv/

On the "API" options, select "items".

Versions

QGIS version 3.39.0-Master
QGIS code revision 399f7df1c7
Qt version 5.15.3
Python version 3.10.3 (Compiled)(Running)
GDAL/OGR version 3.10.0dev-1b32f9f6cf-dirty

QGIS version 3.39.0-Master QGIS code revision 399f7df1c7 Qt version 5.15.3 Python version 3.10.3 (Compiled) (Running) GDAL/OGR version 3.10.0dev-1b32f9f6cf-dirty

Supported QGIS version

New profile

Additional context

No response

doublebyte1 commented 1 month ago

@jerstlouis feel free to add more information here

rouault commented 1 month ago

When trying to add a feature collection, QGIS seems to be looking for tiles.

I suspect the API=ITEMS open option isn't propagated somewhere in QGIS.