minorua / Qgis2threejs

3D map visualization and web export plugin for QGIS
http://minorua.github.io/Qgis2threejs/docs/
GNU General Public License v2.0
514 stars 91 forks source link

Clip DEM With Polygon Layer gives an error #276

Open itsyurig opened 2 years ago

itsyurig commented 2 years ago

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

minorua commented 2 years ago

@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?

itsyurig commented 2 years ago

@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.

quartz-bit commented 2 years ago

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

quartz-bit commented 2 years ago

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

Hi, how to simplify the polygon??

itsyurig commented 2 years ago

@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.