When opening QGIS and add connection to the ArcGIS Feature/Map Service like :https://gis.adem.alabama.gov/arcgis/rest/services it giving me the list of all services and the layers within each service.
Is there a way to do it using PyQGIS ?
I know to load layer with:
QgsVectorLayer(uri, layer_name, "arcgisfeatureserver")
I want to get all the layers available on a source using PyQGIS.
Best Answer
On the webpage of the REST services URL there is a
json
link at the top left. Clicking this will show ajson
of the service metadata, including a list of names. Likewise, a similar link will show ajson
of all the layers in each service.The service names and corresponding layers can be extracted like so: