I'm simply trying to import this feature directly into QGIS 3.16.3-Hannover as a new vector layer:
When loading it into a web browser, it shows the GeoJSON object as follows:
Well, it's not directly a GeoJSON as it's "encapsulated" as the first (and only) element of the JSON array called
Which is probably the source of the following problem...
Because when trying to load it in QGIS*, I first get this message:
Download with "Protocol" source type has failed, do you want to try the "File" source type?
and if I click "No", it then shows this error:
Invalid Data Source: /vsicurl/https://api3.geo.admin.ch/rest/services/api/MapServer/find?layer=ch.swisstopo.swissboundaries3d-land-flaeche.fill&searchText=ch&searchField=id&returnGeometry=true&geometryFormat=geojson is not a valid or recognized data source.
How could I tell QGIS to first unpack the first element of the
results array so that it can (hopefully) read the GeoJSON feature?
Changing the protocol type from HTTP/HTTPS/FTP to GeoJSON does help, but then the feature is not properly loaded on the table of content (it has no geometry):
*I'm trying to load it through the Data Source Manager > Vector > Source Type: "Protocol: HTTP(S), cloud, etc..." and by simply pasting the URL into, well, the URI field.
This is the API doc: https://api3.geo.admin.ch/services/sdiservices.html#find