|
65 | 65 | QgsProcessingFeatureSourceDefinition,
|
66 | 66 | QgsProcessingOutputRasterLayer,
|
67 | 67 | QgsProcessingOutputVectorLayer,
|
| 68 | + QgsProcessingOutputMapLayer, |
68 | 69 | QgsProcessingOutputFile,
|
69 | 70 | QgsProcessingOutputString,
|
70 | 71 | QgsProcessingOutputNumber,
|
@@ -295,14 +296,14 @@ def createWidget(self):
|
295 | 296 | crss = self.dialog.getAvailableValuesOfType((QgsProcessingParameterCrs, QgsProcessingParameterString), QgsProcessingOutputString)
|
296 | 297 | for crs in crss:
|
297 | 298 | self.combo.addItem(self.dialog.resolveValueDescription(crs), crs)
|
298 |
| - raster = self.dialog.getAvailableValuesOfType(QgsProcessingParameterRasterLayer, |
299 |
| - QgsProcessingOutputRasterLayer) |
300 |
| - vector = self.dialog.getAvailableValuesOfType(QgsProcessingParameterFeatureSource, |
301 |
| - QgsProcessingOutputVectorLayer) |
302 |
| - for r in raster: |
303 |
| - self.combo.addItem("Crs of layer " + self.dialog.resolveValueDescription(r), r) |
304 |
| - for v in vector: |
305 |
| - self.combo.addItem("Crs of layer " + self.dialog.resolveValueDescription(v), v) |
| 299 | + layers = self.dialog.getAvailableValuesOfType([QgsProcessingParameterRasterLayer, |
| 300 | + QgsProcessingParameterVectorLayer, |
| 301 | + QgsProcessingParameterFeatureSource], |
| 302 | + [QgsProcessingOutputVectorLayer, |
| 303 | + QgsProcessingOutputRasterLayer, |
| 304 | + QgsProcessingOutputMapLayer]) |
| 305 | + for l in layers: |
| 306 | + self.combo.addItem("Crs of layer " + self.dialog.resolveValueDescription(l), l) |
306 | 307 | if self.param.defaultValue():
|
307 | 308 | self.combo.setEditText(self.param.defaultValue())
|
308 | 309 | return widget
|
@@ -362,16 +363,16 @@ def createWidget(self):
|
362 | 363 | extents = self.dialog.getAvailableValuesOfType(QgsProcessingParameterExtent, (OutputExtent, QgsProcessingOutputString))
|
363 | 364 | if self.param.flags() & QgsProcessingParameterDefinition.FlagOptional:
|
364 | 365 | widget.addItem(self.USE_MIN_COVERING_EXTENT, None)
|
365 |
| - raster = self.dialog.getAvailableValuesOfType(QgsProcessingParameterRasterLayer, |
366 |
| - QgsProcessingOutputRasterLayer) |
367 |
| - vector = self.dialog.getAvailableValuesOfType(QgsProcessingParameterFeatureSource, |
368 |
| - QgsProcessingOutputVectorLayer) |
| 366 | + layers = self.dialog.getAvailableValuesOfType([QgsProcessingParameterFeatureSource, |
| 367 | + QgsProcessingParameterRasterLayer, |
| 368 | + QgsProcessingParameterVectorLayer], |
| 369 | + [QgsProcessingOutputRasterLayer, |
| 370 | + QgsProcessingOutputVectorLayer, |
| 371 | + QgsProcessingOutputMapLayer]) |
369 | 372 | for ex in extents:
|
370 | 373 | widget.addItem(self.dialog.resolveValueDescription(ex), ex)
|
371 |
| - for r in raster: |
372 |
| - widget.addItem("Extent of " + self.dialog.resolveValueDescription(r), r) |
373 |
| - for v in vector: |
374 |
| - widget.addItem("Extent of " + self.dialog.resolveValueDescription(v), v) |
| 374 | + for l in layers: |
| 375 | + widget.addItem("Extent of " + self.dialog.resolveValueDescription(l), l) |
375 | 376 | if not self.param.defaultValue():
|
376 | 377 | widget.setEditText(self.param.defaultValue())
|
377 | 378 | return widget
|
@@ -540,38 +541,44 @@ def _getOptions(self):
|
540 | 541 | options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
|
541 | 542 | QgsProcessingParameterVectorLayer,
|
542 | 543 | QgsProcessingParameterMultipleLayers),
|
543 |
| - QgsProcessingOutputVectorLayer) |
| 544 | + [QgsProcessingOutputVectorLayer, |
| 545 | + QgsProcessingOutputMapLayer]) |
544 | 546 | elif self.param.layerType() == QgsProcessing.TypeVector:
|
545 | 547 | options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
|
546 | 548 | QgsProcessingParameterVectorLayer,
|
547 | 549 | QgsProcessingParameterMultipleLayers),
|
548 |
| - QgsProcessingOutputVectorLayer, |
| 550 | + [QgsProcessingOutputVectorLayer, |
| 551 | + QgsProcessingOutputMapLayer], |
549 | 552 | [QgsProcessing.TypeVector])
|
550 | 553 | elif self.param.layerType() == QgsProcessing.TypeVectorPoint:
|
551 | 554 | options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
|
552 | 555 | QgsProcessingParameterVectorLayer,
|
553 | 556 | QgsProcessingParameterMultipleLayers),
|
554 |
| - QgsProcessingOutputVectorLayer, |
| 557 | + [QgsProcessingOutputVectorLayer, |
| 558 | + QgsProcessingOutputMapLayer], |
555 | 559 | [QgsProcessing.TypeVectorPoint,
|
556 | 560 | QgsProcessing.TypeVectorAnyGeometry])
|
557 | 561 | elif self.param.layerType() == QgsProcessing.TypeVectorLine:
|
558 | 562 | options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
|
559 | 563 | QgsProcessingParameterVectorLayer,
|
560 | 564 | QgsProcessingParameterMultipleLayers),
|
561 |
| - QgsProcessingOutputVectorLayer, |
| 565 | + [QgsProcessingOutputVectorLayer, |
| 566 | + QgsProcessingOutputMapLayer], |
562 | 567 | [QgsProcessing.TypeVectorLine,
|
563 | 568 | QgsProcessing.TypeVectorAnyGeometry])
|
564 | 569 | elif self.param.layerType() == QgsProcessing.TypeVectorPolygon:
|
565 | 570 | options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
|
566 | 571 | QgsProcessingParameterVectorLayer,
|
567 | 572 | QgsProcessingParameterMultipleLayers),
|
568 |
| - QgsProcessingOutputVectorLayer, |
| 573 | + [QgsProcessingOutputVectorLayer, |
| 574 | + QgsProcessingOutputMapLayer], |
569 | 575 | [QgsProcessing.TypeVectorPolygon,
|
570 | 576 | QgsProcessing.TypeVectorAnyGeometry])
|
571 | 577 | elif self.param.layerType() == QgsProcessing.TypeRaster:
|
572 | 578 | options = self.dialog.getAvailableValuesOfType(
|
573 | 579 | (QgsProcessingParameterRasterLayer, QgsProcessingParameterMultipleLayers),
|
574 |
| - QgsProcessingOutputRasterLayer) |
| 580 | + [QgsProcessingOutputRasterLayer, |
| 581 | + QgsProcessingOutputMapLayer]) |
575 | 582 | elif self.param.layerType() == QgsProcessing.TypeVector:
|
576 | 583 | options = self.dialog.getAvailableValuesOfType((QgsProcessingParameterFeatureSource,
|
577 | 584 | QgsProcessingParameterVectorLayer,
|
@@ -760,7 +767,7 @@ def setComboBoxFilters(self, combo):
|
760 | 767 | def getAvailableLayers(self):
|
761 | 768 | return self.dialog.getAvailableValuesOfType(
|
762 | 769 | [QgsProcessingParameterRasterLayer, QgsProcessingParameterVectorLayer, QgsProcessingParameterMapLayer, QgsProcessingParameterString],
|
763 |
| - [QgsProcessingOutputRasterLayer, QgsProcessingOutputVectorLayer, QgsProcessingOutputString, QgsProcessingOutputFile]) |
| 770 | + [QgsProcessingOutputRasterLayer, QgsProcessingOutputVectorLayer, QgsProcessingOutputMapLayer, QgsProcessingOutputString, QgsProcessingOutputFile]) |
764 | 771 |
|
765 | 772 | def selectFile(self):
|
766 | 773 | filename, selected_filter = self.getFileName(self.combo.currentText())
|
@@ -933,7 +940,7 @@ def createWidget(self):
|
933 | 940 | self.combo = QComboBox()
|
934 | 941 | layers = self.dialog.getAvailableValuesOfType(
|
935 | 942 | (QgsProcessingParameterFeatureSource, QgsProcessingParameterVectorLayer),
|
936 |
| - (QgsProcessingOutputVectorLayer, QgsProcessingOutputString, QgsProcessingOutputFile), self.param.dataTypes()) |
| 943 | + (QgsProcessingOutputVectorLayer, QgsProcessingOutputMapLayer, QgsProcessingOutputString, QgsProcessingOutputFile), self.param.dataTypes()) |
937 | 944 | self.combo.setEditable(True)
|
938 | 945 | for layer in layers:
|
939 | 946 | self.combo.addItem(self.dialog.resolveValueDescription(layer), layer)
|
@@ -1217,7 +1224,7 @@ def createWidget(self):
|
1217 | 1224 | self.combo = QComboBox()
|
1218 | 1225 | self.combo.setEditable(True)
|
1219 | 1226 | tables = self.dialog.getAvailableValuesOfType((QgsProcessingParameterVectorLayer, QgsProcessingParameterString),
|
1220 |
| - (QgsProcessingOutputVectorLayer, QgsProcessingOutputFile, QgsProcessingOutputString)) |
| 1227 | + (QgsProcessingOutputVectorLayer, QgsProcessingOutputMapLayer, QgsProcessingOutputFile, QgsProcessingOutputString)) |
1221 | 1228 | if self.param.flags() & QgsProcessingParameterDefinition.FlagOptional:
|
1222 | 1229 | self.combo.addItem(self.NOT_SELECTED, None)
|
1223 | 1230 | for table in tables:
|
|
0 commit comments