Skip to content

Commit

Permalink
Merge pull request #48 from OnroerendErfgoed/development
Browse files Browse the repository at this point in the history
fix for choosing referencelayer
  • Loading branch information
dieuska authored Sep 16, 2024
2 parents bbf410d + bb51db8 commit aadc998
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions autocorrectborders.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def initAlgorithm(self, config=None):
self.INPUT_REFERENCE,
self.tr("REFERENCE LAYER"),
[QgsProcessing.TypeVectorAnyGeometry],
defaultValue="reference",
# defaultValue="reference",
optional=True
)
parameter.setFlags(parameter.flags())
Expand Down Expand Up @@ -610,12 +610,6 @@ def processAlgorithm(self, parameters, context, feedback):

self.prepare_parameters(parameters)

if self.SELECTED_REFERENCE == 0 and (
parameters[self.INPUT_REFERENCE] is None or str(parameters[self.ID_REFERENCE]) == 'NULL'):
raise QgsProcessingException(
"Please choose a REFERENCELAYER from the table of contents, and the associated unique REFERENCE ID"
)

thematic, thematic_buffered = self._thematic_preparation(
context, feedback, outputs, parameters
)
Expand Down Expand Up @@ -982,6 +976,10 @@ def prepare_parameters(self, parameters):
ref_suffix = str(ref)
else:
self.SELECTED_REFERENCE = 0

if parameters[self.INPUT_REFERENCE] is None or str(parameters[self.ID_REFERENCE]) == 'NULL':
raise QgsProcessingException(
"Please choose a REFERENCELAYER from the table of contents, and the associated unique REFERENCE ID")
self.LAYER_REFERENCE = QgsProject.instance().layerTreeRoot().findLayer(
parameters[self.INPUT_REFERENCE]).name()
ref_suffix = self.PREFIX_LOCAL_LAYER + "_" + self.LAYER_REFERENCE
Expand Down

0 comments on commit aadc998

Please sign in to comment.