0

I would like to know how to bind the methods used by the "Connect" button which retrieve services capabilities through the OWSConnect to correctly build the URL with paramas (or QgsDataSourceURI) from each layer capacity without opening the dialog or request the GetCapabilities URL by myself.

I'm looking for a "pure" PyQGIS solution, not using a dependency like OWSLib because I need parse ArcGIS Server services (Map and Features).

Any idea?

QGIS OWS Connection - WMS

I'm interested in PyQGIS 2.18.x and 3.x.

Guts
  • 612
  • 1
  • 6
  • 12
  • @nmtoken could you tell me why it's duplicated please? I've seen the other question before but it doesn't solve mine at all! – Guts Apr 13 '18 at 15:19
  • I marked it as duplicate because it appears to be asking the same question. Others have looked and agreed. However, if you think it isn't a duplicate you'll need to explain why. You say in your edit OWSLib because I need parse ArcGIS Server services (Map and Features). but OWSLib deals in interface standards such as WMS and WMST, so will work with services provided by ArcGIS, just as well as Mapserver or Geoserver. I'm assuming that you mean OGC interface standards such as those mentioned because you talk about GetCapabilities, which is an operation of such standards. – nmtoken Apr 13 '18 at 15:45
  • To me ArcGIS Server services (Map and Features). in combination with your phase ending without opening the dialog or request the GetCapabilities URL by myself. means you want to access OGC WMS and OGC WFS supplied by ArcGIS, and owslib can handle those. If you don't mean such services using such standards, then you might want to ask a different question! I take on board though you want a pure approach and not use owslib, it's just the reasoning seems a little misguided. – nmtoken Apr 13 '18 at 15:55
  • AcrGIS Services (Map and Features) do not mean OGC services provided by ArcGIS Server but REST services that could be added through QGIS interface (and formerly by the ArcGIS REST API Connector, previously to QGIS v2.16).

    In PyQGIS, you can add a layer if you know everything about it: "(CRS, layername...) : QgsVectorLayer(service_layer_uri(), 'Manual - Esri Feature Service', 'arcgisfeatureserver')".

    What I ask is how to obtain the details about the service, exactly as QGIS UI does (in https://qgis.org/api/2.18/classQgsSourceSelectDialog.html#details)

    – Guts Apr 13 '18 at 16:35
  • But ArcGIS Server REST API does not have a GetCapabilities operation, that is an operation defined by OWS common for OGC services such as WMS, WFS and WCS, so the terms in the question are misleading, you mention GetCapabilities and you show a popup for WMS/WMTS which all point to OWS services. but you want to know about non-OWS services. Probably you should ask another question about using PyQGIS and ArcGIS REST API, and leave this question as applicable to OWS services only, without the use of owslib. – nmtoken Apr 13 '18 at 16:50

0 Answers0