Skip to content

Commit

Permalink
skip invalid geometry (fix #298)
Browse files Browse the repository at this point in the history
  • Loading branch information
minorua committed Jan 10, 2024
1 parent e485685 commit cc32e8c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions buildvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,18 @@ def features(self, request=None):
# geometry
geom = f.geometry()
if geom is None:
logMessage("null geometry skipped")
logMessage("Null geometry skipped: " + self.name)
continue

# coordinate transformation - layer crs to project crs
geom = QgsGeometry(geom)

if not geom.isGeosValid():
logMessage("Invalid geometry skipped: " + self.name)
continue

# coordinate transformation - layer crs to project crs
if geom.transform(self.transform) != 0:
logMessage("Failed to transform geometry")
logMessage("Failed to transform geometry: " + self.name)
continue

if rotation and self.onlyIntersecting:
Expand Down

0 comments on commit cc32e8c

Please sign in to comment.