| | |
| | | |
| | | from qgis.core import * |
| | | # C:\Program Files\QGIS 3.16\apps\qgis-ltr\python\qgis |
| | | sys.path.append(r"C:\Program Files\QGIS 3.16\apps\qgis-ltr\python\plugins") |
| | | from processing.core.Processing import Processing |
| | | Processing.initialize() |
| | | import processing |
| | | #from qgis import processing |
| | | |
| | | |
| | | import math |
| | | import argparse |
| | |
| | | from qgis.PyQt.QtGui import * |
| | | from qgis.PyQt.QtCore import * |
| | | from qgis.PyQt.QtWidgets import * |
| | | #from qgis import processing |
| | | |
| | | |
| | | # è·å宿´è·¯å¾ |
| | |
| | | layer = QgsRasterLayer(line, "layer_" + str(i)) |
| | | if not layer.isValid(): |
| | | print("layer_" + str(i) + ": failed to load!") |
| | | #prj.addRasterLayer(line, "layer_" + str(i)) |
| | | |
| | | |
| | | # åå§å |
| | | def init(): |
| | | # QgsApplication.setPrefixPath("C:\Program Files\QGIS 3.16", True) |
| | | qgs = QgsApplication([], True) |
| | | qgs = QgsApplication([], False) |
| | | qgs.initQgis() |
| | | |
| | | sys.path.append(r"C:\Program Files\QGIS 3.16\apps\qgis-ltr\python\plugins") |
| | | from processing.core.Processing import Processing |
| | | Processing.initialize() |
| | | import processing |
| | | |
| | | args = get_args() |
| | | project = QgsProject.instance() |
| | |
| | | print("FileName: " + project.fileName()) |
| | | |
| | | loadLayers(project, args) |
| | | |
| | | for alg in qgs.processingRegistry().algorithms(): |
| | | print(alg.id(), "->", alg.displayName()) |
| | | |
| | | ops = { |
| | | 'BACKGROUND_COLOR': QColor(0, 0, 0, 0), |