菜单->插件->python console
两条命令:
1.定义数据库链接:
uri = "MSSQL: server=.;database=maps;tables=county;trusted_connection=yes"
2.导入新图层:
qgis.utils.iface.addVectorLayer(uri,'thelayer','ogr')
本文转自 boyi55 51CTO博客,原文链接:http://blog.51cto.com/boyi55/615488,如需转载请自行联系原作者