本文整理汇总了Python中processing.core.QGisLayers.QGisLayers.load方法的典型用法代码示例。如果您正苦于以下问题:Python QGisLayers.load方法的具体用法?Python QGisLayers.load怎么用?Python QGisLayers.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类processing.core.QGisLayers.QGisLayers
的用法示例。
在下文中一共展示了QGisLayers.load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handleAlgorithmResults
# 需要导入模块: from processing.core.QGisLayers import QGisLayers [as 别名]
# 或者: from processing.core.QGisLayers.QGisLayers import load [as 别名]
def handleAlgorithmResults(alg, progress, showResults = True):
wrongLayers = []
htmlResults = False;
progress.setText("Loading resulting layers")
i = 0
for out in alg.outputs:
progress.setPercentage(100 * i / float(len(alg.outputs)))
if out.hidden or not out.open:
continue
if isinstance(out, (OutputRaster, OutputVector, OutputTable)):
try:
if out.value.startswith("memory:"):
layer = out.memoryLayer
QgsMapLayerRegistry.instance().addMapLayers([layer])
else:
if ProcessingConfig.getSetting(ProcessingConfig.USE_FILENAME_AS_LAYER_NAME):
name = os.path.basename(out.value)
else:
name = out.description
QGisLayers.load(out.value, name, alg.crs, RenderingStyles.getStyle(alg.commandLineName(),out.name))
except Exception, e:
wrongLayers.append(out)
#QMessageBox.critical(None, "Error", str(e))
elif isinstance(out, OutputHTML):
ProcessingResults.addResult(out.description, out.value)
htmlResults = True
示例2: load
# 需要导入模块: from processing.core.QGisLayers import QGisLayers [as 别名]
# 或者: from processing.core.QGisLayers.QGisLayers import load [as 别名]
def load(path):
"""Loads a layer into QGIS"""
return QGisLayers.load(path)
示例3: loadTestData
# 需要导入模块: from processing.core.QGisLayers import QGisLayers [as 别名]
# 或者: from processing.core.QGisLayers.QGisLayers import load [as 别名]
def loadTestData():
QGisLayers.load(points(), "points")
QGisLayers.load(points2(), "points2")
QGisLayers.load(polygons(), "polygons")
QGisLayers.load(polygons2(), "polygons2")
QGisLayers.load(polygonsGeoJson(), "polygonsGeoJson")
QGisLayers.load(lines(), "lines")
QGisLayers.load(raster(), "raster")
QGisLayers.load(table(), "table")
QGisLayers.load(union(), "union")