Skip to content

Commit

Permalink
Delete fields before segmentarization
Browse files Browse the repository at this point in the history
  • Loading branch information
pathmapper committed May 21, 2024
1 parent 748905e commit 5425f90
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 5 deletions.
1 change: 1 addition & 0 deletions metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ server=False
hasProcessingProvider=yes
changelog=unreleased:
- Raster-Hilfswerkzeuge: Komprimiere erzeugte Rasterpläne mit Deflate
- Raster-Hilfswerkzeuge: Behebe Fehler für bestimmte Polygone
v2.10.0:
- Raster-Hilfswerkzeuge: Option zum Leerwert setzen
v2.9.0:
Expand Down
22 changes: 20 additions & 2 deletions xplan_umring_algorithm_clip_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,28 @@ def processAlgorithm(self, parameters, context, feedback):
if no_data:
palett_index = 0

# Zu erhaltende Felder
alg_params = {
"FIELDS": [""],
"INPUT": parameters["polygon_zum_zuschneiden_vektor"],
"OUTPUT": QgsProcessing.TEMPORARY_OUTPUT,
}
outputs["ZuErhaltendeFelder"] = processing.run(
"native:retainfields",
alg_params,
context=context,
feedback=feedback,
is_child_algorithm=True,
)

feedback.setCurrentStep(1)
if feedback.isCanceled():
return {}

# Durch maximalen Abstand segmentieren
alg_params = {
"DISTANCE": 0.01,
"INPUT": parameters["polygon_zum_zuschneiden_vektor"],
"INPUT": outputs["ZuErhaltendeFelder"]["OUTPUT"],
"OUTPUT": QgsProcessing.TEMPORARY_OUTPUT,
}
outputs["DurchMaximalenAbstandSegmentieren"] = processing.run(
Expand All @@ -138,7 +156,7 @@ def processAlgorithm(self, parameters, context, feedback):
is_child_algorithm=True,
)

feedback.setCurrentStep(1)
feedback.setCurrentStep(2)
if feedback.isCanceled():
return {}

Expand Down
24 changes: 21 additions & 3 deletions xplan_umring_algorithm_difference_raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,29 @@ def processAlgorithm(self, parameters, context, feedback):
feedback.setCurrentStep(1)
if feedback.isCanceled():
return {}

# Zu erhaltende Felder
alg_params = {
"FIELDS": [""],
"INPUT": parameters["polygon_zum_abziehen"],
"OUTPUT": QgsProcessing.TEMPORARY_OUTPUT,
}
outputs["ZuErhaltendeFelder"] = processing.run(
"native:retainfields",
alg_params,
context=context,
feedback=feedback,
is_child_algorithm=True,
)

feedback.setCurrentStep(2)
if feedback.isCanceled():
return {}

# Durch maximalen Abstand segmentieren
alg_params = {
"DISTANCE": 0.01,
"INPUT": parameters["polygon_zum_abziehen"],
"INPUT": outputs["ZuErhaltendeFelder"]["OUTPUT"],
"OUTPUT": QgsProcessing.TEMPORARY_OUTPUT,
}
outputs["DurchMaximalenAbstandSegmentieren"] = processing.run(
Expand All @@ -156,7 +174,7 @@ def processAlgorithm(self, parameters, context, feedback):
is_child_algorithm=True,
)

feedback.setCurrentStep(2)
feedback.setCurrentStep(3)
if feedback.isCanceled():
return {}

Expand All @@ -175,7 +193,7 @@ def processAlgorithm(self, parameters, context, feedback):
is_child_algorithm=True,
)

feedback.setCurrentStep(3)
feedback.setCurrentStep(4)
if feedback.isCanceled():
return {}

Expand Down

0 comments on commit 5425f90

Please sign in to comment.