3

I have a password protected ArcGIS-FeatureServer Service, the service provides 25 layers.

Using "Add Layer --> Add ArcGIS-FeatureServer-Layer" works like it should.

Is there any way to add these kind of layers with PyQGIS? I could not find a documentation or example anywhere.

How to Add a normal WFS layer with PyQGIS is well documented.

For ArcGIS MapServer it is super-easy:

iface.addRasterLayer("url='my_featuere_layer_url' layer='0'", "mylayer", "arcgismapserver")

But the provider "arcgismapserver" is not documented anywhere, just found an example after some search, so I expect that there is a similar solution for ArcGIS-FeatureServer.

2

After all, the answer is quite simple (but nowhere documented):

uri = "crs='EPSG:25832' filter='' url='http://someurl.com/featureserver' table="" sql="
my_layer = QgsVectorLayer(uri, "layername", "arcgisfeatureserver")

The lack of documentation leads to a lot of other questions (bounding-box, username, password, ...)

0

Check out the ArcGISConnector-QGIS-Plugin connector.py file. Looks like it requests the features service as json using the requests module.

  • 1
    Thx, already checked that out, but hoping for an easier solution and it seems to be a very complicated solution. For ArcGIS MapServer it is super-easy, therefore I assume a similar solution for ArcGIS FeatureServer, it is just not documented. – AndreasK Oct 30 '17 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.