Qgis2threejs icon indicating copy to clipboard operation
Qgis2threejs copied to clipboard

Clip DEM With Polygon Layer gives an error

Open itsyurig opened this issue 2 years ago • 5 comments

Projected all the layers to the same CRS, this feature worked fine before but now a day later it gives me this error, someone help? I'm trying to clip SRTM data with a shape layer.

2022-03-23T16:22:47 WARNING Traceback (most recent call last): File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 316, in _processRequests self.buildScene() File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 205, in buildScene self.buildLayers() File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 220, in buildLayers if not self._buildLayer(layer) or self.aborted: File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 275, in _buildLayer obj = builder.build() File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\builddem.py", line 203, in build geom = self.clipped(self.clip_geometry) File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\builddem.py", line 270, in clipped polys = grid.splitPolygon(clip_geometry) File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\geometry.py", line 581, in splitPolygon for poly in self._splitPolygon(geom): File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\geometry.py", line 609, in _splitPolygon triangles = earcut.earcut(v, data["holes"], data["dimensions"]) File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 39, in earcut earcutLinked(outerNode, triangles, dim, minX, minY, invSize) File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 97, in earcutLinked indexCurve(ear, minX, minY, invSize) File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 357, in indexCurve p.z = zOrder(p.x, p.y, minX, minY, invSize) File "C:\Users/itsyu/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 428, in zOrder x = (x | (x TypeError: unsupported operand type(s) for

itsyurig avatar Mar 23 '22 12:03 itsyurig

@itsyurig Can you check the validity of geometries of the polygon layer using check validity tool in processing toolbox or attach the file set of polygon layer to this issue?

minorua avatar Mar 25 '22 03:03 minorua

@itsyurig Can you check the validity of geometries of the polygon layer using check validity tool in processing toolbox or attach the file set of polygon layer to this issue?

Thanks for the reply. Simplifying the polygon shape seems to fix the problem I was running into. So this isn't a bug I think.

itsyurig avatar Mar 25 '22 10:03 itsyurig

Hi ! I have the same problem and didn't know what to do. Please help. Thank you..

quartz-bit avatar Mar 28 '22 11:03 quartz-bit

Hi ! I have the same problem and didn't know what to do. Please help. Thank you..

Hi, how to simplify the polygon??

quartz-bit avatar Mar 28 '22 11:03 quartz-bit

@quartz-bit Go to Vector>Geometery Tools>Simplify. But you might first need to reproject the layer to the UTM coordinate system so that the simplify tool can do simplification with meters instead of degrees. do the 100m simlification and see if that helps, if not try 1000m and so on. GL.

itsyurig avatar Mar 28 '22 13:03 itsyurig