Skip to content

Instantly share code, notes, and snippets.

@yellow-sky
Last active August 29, 2015 14:11
Show Gist options
  • Save yellow-sky/e2b4ff752c49aef887e0 to your computer and use it in GitHub Desktop.
Save yellow-sky/e2b4ff752c49aef887e0 to your computer and use it in GitHub Desktop.
add wms
wms_url = 'http://maps.rosreestr.ru/arcgis/services/Cadastre/CadastreWMS/MapServer/WMSServer?format=image/png&layers=1&styles=&crs=EPSG:3857'
layer = QgsRasterLayer('url=%s' % wms_url, 'Test WMS', 'wms')
if not layer.isValid():
QgsMessageLog.logMessage('ops', level=QgsMessageLog.CRITICAL)
else:
QgsMapLayerRegistry.instance().addMapLayer(layer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment