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 SextanteConfig.getSetting(SextanteConfig.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): SextanteResults.addResult(out.description, out.value) htmlResults = True
def handleAlgorithmResults(alg, showResults=True): htmlResults = False for out in 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().addMapLayer(layer) else: if SextanteConfig.getSetting( SextanteConfig.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: QMessageBox.critical(None, "Error", str(e)) elif isinstance(out, OutputHTML): SextanteResults.addResult(out.description, out.value) htmlResults = True
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 SextanteConfig.getSetting( SextanteConfig.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): SextanteResults.addResult(out.description, out.value) htmlResults = True
def handleAlgorithmResults(alg, showResults = True): htmlResults = False; for out in 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().addMapLayer(layer) else: if SextanteConfig.getSetting(SextanteConfig.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: QMessageBox.critical(None, "Error", str(e)) elif isinstance(out, OutputHTML): SextanteResults.addResult(out.description, out.value) htmlResults = True
def loadTestData(): QGisLayers.load(points(), "points") QGisLayers.load(points2(), "points2") QGisLayers.load(polygons(), "polygons") QGisLayers.load(polygons2(), "polygons2") QGisLayers.load(lines(), "lines") QGisLayers.load(raster(), "raster") QGisLayers.load(table(), "table") QGisLayers.load(union(), "union")
def load(path): '''Loads a layer into QGIS''' return QGisLayers.load(path)
def load(layer): '''Loads a layer into QGIS''' QGisLayers.load(layer)
def load(path): """Loads a layer into QGIS""" return QGisLayers.load(path)
def load(layer): """Loads a layer into QGIS""" QGisLayers.load(layer)
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")