3

My objective is to fetch maps provided by openLayers, as in openLayers_plugin, from a stand alone python script. I would like to get it superposed to my shp file.

As can be read on http://www.qgis.org/fr/docs/pyqgis_developer_cookbook/loadlayer.html

layer = QgsVectorLayer(data_source, layer_name, provider_name)
if not layer.isValid():print "Layer failed to load!"

provide a good way for loading layer in a stand alone python script. And it's possible to do it as well for wfs data source, or other data source types.
I do it with shp files, and it works well, but what is the uri related to openLayers datas and maps ?

I also tried to get openLayers_plugin ...

sys.path.append(r"C:\usr\python\plugins\openlayers_plugin")
qgis.utils.loadPlugin('openlayers')     
qgis.utils.startPlugin('openlayers')
print qgis.utils.isPluginLoaded('openlayers') # return False

Is it possible to use openlayers plugin in stand alone pyqgis script ? cf [ Can I use QGIS plugins in PyQGIS as a stand alone script without iface? ] which is deprecated now. No it's not ?

keepAlive
  • 350
  • 1
  • 8
  • Incidentally, this question, considered as an exact duplicate, is anterior to the so-called existing question. – keepAlive Aug 06 '17 at 23:55

0 Answers0