-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ArcGIS feature Service Layer with Python doesn't work in QGIS 3.28 #53736
Comments
It seems that removing The following code therefore works in QGIS 3.28 and QGIS 3.22: # -*- coding: utf-8 -*-
from qgis.core import QgsDataSourceUri, QgsProject, QgsVectorLayer
from owslib.wfs import WebFeatureService
wfs_url_base = "crs='EPSG:2154' url='{service_url}/{layer_id}'"
lyr = QgsVectorLayer(wfs_url_base, baseName="efs_arcgisserver", providerLib="arcgisfeatureserver")
QgsProject.instance().addMapLayer(lyr) However, I'm not aware of any documentation indicating this. If such documentation exists, I'd be grateful if someone could point it out to me. If not, perhaps it's not a bug but a need for documentation. |
there's a bit happening here! First, the issue is caused by the The correct uri should either exclude the Special handling has been added in #54806 to treat |
Thanks for the explanation @nyalldawson |
What is the bug or the crash?
Hello,
I would like to start by thanking you for all the work you have been doing for so many years.
I am the developer of a Python plugin that allows the user to add ESRI Feature Service layers.
This feature works perfectly in QGIS 3.22. However, in QGIS 3.28 (I tested in QGIS 3.28.4 and 3.28.8) the QgsVectorLayers I generate from EFS layers are no longer valid. However, it is still possible to add these layers manually in QGIS 3.28 from the "ArcGIS Server REST" data source manager.
Steps to reproduce the issue
Here's the URL of an open service with which you can test: https://carto.isogeo.net/server/rest/services/scan_services_1/EMS_EFS_WMS_WFS/FeatureServer/
Here's an example of Python code that works in QGIS 3.22 but not in QGIS 3.28:
Running this code in QGIS 3.22 add a valid layer to the canvas. However, running it in QGIS 3.28 add an invalid layer :
Versions
<style type="text/css"> p, li { white-space: pre-wrap; } </style>Extensions Python actives
isogeo-plugin-qgis
3.4.1-beta
plugin_reloader
0.9.3
quick_map_services
0.19.33
db_manager
0.1.20
grassprovider
2.12.99
MetaSearch
0.3.6
processing
2.12.99
sagaprovider
2.12.99
Supported QGIS version
New profile
Additional context
This bug may be linked to #51409
The text was updated successfully, but these errors were encountered: