[Qgis-user] PyQGIS - OGCFeatureService / QgsVectorLayer "OAPIF"

Andrew Hughes ahhughes at gmail.com
Thu Jun 2 21:37:03 PDT 2022


Hi All,

Simple question, but this doesn't work and I have no idea why.

The following returns False, and has no features. Can someone please tell
me what I am doing wrong -  this seems so simple and really there is
nothing I can think of that is wrong with this, but doesn't work?

QgsVectorLayer('
https://services.arcgis.com/quV9d0y7GW2PJkRl/arcgis/rest/services/rpt_spv_str_restr_prod_ogcfl/OGCFeatureServer',
"layer_name", "OAPIF").isValid()


For reference, this is QGIS v3.16.11. Also, this DOES work when I add this
URL as a WFS / OGC API to the QGIS Browser.

Thanks in advance,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20220603/629498f6/attachment.htm>


More information about the Qgis-user mailing list