Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CHANGELOG

## 4.17.3 - dev
## 4.17.5 - dev

Novas Funcionalidades:

Expand All @@ -12,7 +12,8 @@ Melhorias:
- Atualiza o modelo EDGV 3.0 para a implementação 1.1.6;
- Correção do comportamento do toggle layers;
- Corrige mensagem de erro quando o BDGEx não está acessível;
- Atualiza Create Review Grid para ficar compatível com os atributos previstos no SAP Operador 3.29.14
- Atualiza Create Review Grid para ficar compatível com os atributos previstos no SAP Operador 3.29.14;
- Melhora o desempenho do algoritmo de construir polígonos por linha e centróide;

Correção de bugs:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def processAlgorithm(self, parameters, context, feedback):
inputLyr=polygonsNotOnEdge,
joinLyr=polygonsNotOnEdge,
joinFields=[],
predicateList=[AlgRunner.Intersect],
predicateList=[AlgRunner.Intersects],
summaries=[0],
feedback=multiStepFeedback,
context=context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ def buildGrid(self, parameters, context, inputRaster, feedback, polygonLayer):
selectedGrid = self.algRunner.runExtractByLocation(
inputLyr=grid,
intersectLyr=polygonsNotOnEdge,
predicate=[AlgRunner.Contain],
predicate=[AlgRunner.Contains],
context=context,
feedback=multiStepFeedback,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def flagFeatures(
inputLyr=outputLyr,
intersectLyr=geographicBoundaryLyr,
context=context,
predicate=[AlgRunner.Intersect if self.mode == 1 else AlgRunner.Within],
predicate=[AlgRunner.Intersects if self.mode == 1 else AlgRunner.Within],
)
if geographicBoundaryLyr is not None and self.mode != 0
else outputLyr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def relatePolygons(
joinnedSeamline = self.algRunner.runJoinAttributesByLocation(
inputLyr=valueDict["SEAMLINES_SHAPE"],
joinLyr=valueDict["TILE_SHAPE"],
predicateList=[AlgRunner.Intersect],
predicateList=[AlgRunner.Intersects],
method=0,
context=context,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def processAlgorithm(self, parameters, context, feedback):
inputLyr=nodesLayer,
intersectLyr=waterSinkLayer,
context=context,
predicate=[AlgRunner.Equal],
predicate=[AlgRunner.Equals],
feedback=multiStepFeedback,
)
for feat in selectedNodesFromWaterSink.getFeatures():
Expand All @@ -326,7 +326,7 @@ def processAlgorithm(self, parameters, context, feedback):
inputLyr=nodesLayer,
intersectLyr=buffer,
context=context,
predicate=[AlgRunner.Intersect],
predicate=[AlgRunner.Intersects],
feedback=multiStepFeedback,
)
for feat in selectedNodesFromOcean.getFeatures():
Expand All @@ -340,7 +340,7 @@ def processAlgorithm(self, parameters, context, feedback):
inputLyr=nodesLayer,
intersectLyr=waterBodyWithFlowLayer,
context=context,
predicate=[AlgRunner.Intersect],
predicate=[AlgRunner.Intersects],
feedback=multiStepFeedback,
)
nodesDict = defaultdict(list)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def processAlgorithm(self, parameters, context, feedback):
inputLyr=nodesLyr,
intersectLyr=geographicBoundaryLyr,
context=context,
predicate=[AlgRunner.Intersect],
predicate=[AlgRunner.Intersects],
feedback=multiStepFeedback,
)
if geographicBoundaryLyr is not None
Expand Down
80 changes: 52 additions & 28 deletions DsgTools/core/DSGToolsProcessingAlgs/algRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ class AlgRunner:
RMSA,
) = range(13)
(
Intersect,
Contain,
Intersects,
Contains,
Disjoint,
Equal,
Touch,
Overlap,
Equals,
Touches,
Overlaps,
Within,
Cross,
Crosses,
) = range(8)
(
AlignNodesInsertExtraVerticesWhereRequired, # Prefer aligning nodes, insert extra vertices where required
Expand Down Expand Up @@ -1026,31 +1026,33 @@ def runPolygonize(

def runJoinAttributesByLocation(
self,
inputLyr,
joinLyr,
context,
predicateList=None,
joinFields=None,
method=None,
discardNonMatching=True,
feedback=None,
outputLyr=None,
unjoinnedLyr=None,
returnUnjoinned=False,
is_child_algorithm=False,
inputLyr: QgsVectorLayer,
joinLyr: QgsVectorLayer,
context: QgsProcessingContext,
predicateList: Optional[List[int]]=None,
joinFields: Optional[List[str]]=None,
method: Optional[int]=None,
discardNonMatching: Optional[bool]=True,
prefix: Optional[str]=None,
feedback: Optional[QgsFeedback]=None,
outputLyr: Optional[QgsVectorLayer]=None,
unjoinnedLyr: Optional[QgsVectorLayer]=None,
returnUnjoinned: Optional[bool]=False,
is_child_algorithm: Optional[bool]=False,
) -> QgsVectorLayer:
predicateList = [0] if predicateList is None else predicateList
joinFields = [] if joinFields is None else joinFields
method = 0 if method is None else method
outputLyr = "memory:" if outputLyr is None else outputLyr
prefix = "" if prefix is None else prefix
parameters = {
"INPUT": inputLyr,
"JOIN": joinLyr,
"PREDICATE": predicateList,
"JOIN_FIELDS": joinFields,
"METHOD": method,
"DISCARD_NONMATCHING": discardNonMatching,
"PREFIX": "",
"PREFIX": prefix,
"OUTPUT": outputLyr,
}
output = processing.run(
Expand Down Expand Up @@ -1090,14 +1092,14 @@ def runLineIntersections(

def runStatisticsByCategories(
self,
inputLyr,
context,
valuesFieldName=None,
categoriesFieldName=None,
feedback=None,
outputLyr=None,
is_child_algorithm=False,
):
inputLyr: QgsVectorLayer,
context: QgsProcessingContext,
valuesFieldName: Optional[str]=None,
categoriesFieldName: str=None,
feedback: Optional[QgsProcessingContext]=None,
outputLyr: Optional[QgsVectorLayer]=None,
is_child_algorithm: Optional[bool]=False,
) -> QgsVectorLayer:
outputLyr = "memory:" if outputLyr is None else outputLyr
parameters = {
"INPUT": inputLyr,
Expand Down Expand Up @@ -2570,7 +2572,6 @@ def runDSGToolsLoadShapefile(
feedback=feedback,
is_child_algorithm=is_child_algorithm,
)
return output["OUTPUT"]

def runDSGToolsExtractMiddleVertexOnLine(
self,
Expand All @@ -2592,3 +2593,26 @@ def runDSGToolsExtractMiddleVertexOnLine(
is_child_algorithm=is_child_algorithm,
)
return output["OUTPUT"]

def runRetainFields(
self,
inputLayer: QgsVectorLayer,
fieldList: List[str],
context: QgsProcessingContext,
outputLyr: Optional[QgsRasterLayer] = None,
feedback: Optional[QgsFeedback] = None,
is_child_algorithm: bool = False,
) -> QgsVectorLayer:
outputLyr = "memory:" if outputLyr is None else outputLyr
output = processing.run(
"native:retainfields",
{
"INPUT": inputLayer,
"FIELDS": fieldList,
"OUTPUT": outputLyr,
},
context=context,
feedback=feedback,
is_child_algorithm=is_child_algorithm,
)
return output["OUTPUT"]
4 changes: 2 additions & 2 deletions DsgTools/core/GeometricTools/graphHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,9 +1238,9 @@ def find_constraint_points(
else constraintLayer
)
predicate = (
AlgRunner.Intersect
AlgRunner.Intersects
if constraintLayer.geometryType() != QgsWkbTypes.PointGeometry
else AlgRunner.Equal
else AlgRunner.Equals
)
selectedNodesFromOcean = algRunner.runExtractByLocation(
inputLyr=nodesLayer,
Expand Down
Loading
Loading