Skip to content

Commit

Permalink
Merge pull request #132 from MIERUNE/feat/handle-invalid-geometries
Browse files Browse the repository at this point in the history
Fix geometries
  • Loading branch information
Kanahiro authored Aug 15, 2023
2 parents f80355c + 7d6a8e8 commit 8b24e25
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion translator/vector/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,19 @@ def _clip_in_projectcrs(layer: QgsVectorLayer, extent: QgsRectangle) -> QgsVecto
QgsVectorLayer: clipped layer in Project CRS
"""

layer_cleaned = processing.run(
"native:fixgeometries",
{
"INPUT": layer,
"METHOD": 1,
"OUTPUT": "TEMPORARY_OUTPUT",
},
)["OUTPUT"]

reprojected = processing.run(
"native:reprojectlayer",
{
"INPUT": layer,
"INPUT": layer_cleaned,
"TARGET_CRS": QgsProject.instance().crs(),
"OUTPUT": "TEMPORARY_OUTPUT",
},
Expand Down

0 comments on commit 8b24e25

Please sign in to comment.