Hello,
I would like to ask how to enable proxies when adding WMTS via WMS. On
server where I run standalone QGIS python to access the WMTS I need to
execute below commands to be able connect from server to net.

export http_proxy=http://xx.xx.xx.xx:8080/
export https_proxy=https://xx.xx.xx.xx:8080/

I tried to add to below code via subprocess.run, but no success

projectName = 'wms_load'
project = QgsProject.instance()
urlWithParams =
'crs=EPSG:3857&dpiMode=7&format=image/png&layers=geolandbasemap&styles=normal&tileMatrixSet=google3857&url=https://www.basemap.at/wmts/1.0.0/WMTSCapabilities.xml'

rlayer = QgsRasterLayer(urlWithParams, 'geolandbasemap', 'wms')
if not rlayer.isValid():
  print("Layer failed to load!")
else:
    print('Layer loaded')
project.addMapLayer(rlayer)

project = QgsProject.instance()
project.write()

qgs.exitQgis()


Thank you
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to