minorua / Qgis2threejs

3D map visualization and web export plugin for QGIS
http://minorua.github.io/Qgis2threejs/docs/
495 stars 91 forks source link

Facing problemas with "Clip DEM with polygon layer" tool #264

Closed GeoPontes closed 2 years ago

GeoPontes commented 2 years ago

Hey guys!

First, thanks creating and maintaning this amazing tool. Secondly, I'd like to report an strange behaviour that I'm experiencing in QGIS 3.16. I have a raster layer obtained through processing of a considerable number of SRTM files (30m of spacial resolution). Also, I have a .shp which delimites the catchment area of a brazillian basin. Both files match in extent and coordinate system. (figure 1)

fig1

Whenever I try to utilize the "Clip DEM with polygon layer" tool, within "Layer Properties" Menu, the plugin screen frozes (figure 2). I also get an error on QGIS. Actually a yellow bar appears suggesting me to check for erros on the log file (figure 3). The errors, both from Python and Qgis2threejs are shown below. Other presentation set ups work fine.

fig2

fig3

Could anyone have a hint on what may be the cause of the problem I’m facing?

Thanks!

ERROR MESSAGE FROM LOG:

2021-11-29T13:04:50 INFO Opening Qgis2threejs Exporter... 2021-11-29T13:05:57 WARNING Traceback (most recent call last): File "C:/Users/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 337, in _processRequests self.buildLayer(layer) File "C:/Users/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 253, in buildLayer aborted = self._buildLayer(layer) File "C:/Users/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 288, in _buildLayer obj = builder.build() File "C:/Users/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\builddem.py", line 202, in build geom = self.clipped(self.clip_geometry) File "C:/Users/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\builddem.py", line 299, in clipped polys = grid.splitPolygon(clip_geometry) File "C:/Users/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\geometry.py", line 620, in splitPolygon for poly in self._splitPolygon(geom): File "C:/Users/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\geometry.py", line 648, in _splitPolygon triangles = earcut.earcut(v, data["holes"], data["dimensions"]) File "C:/Users/ALM/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/ALM/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\earcut\earcut.py", line 97, in earcutLinked indexCurve(ear, minX, minY, invSize) File "C:/Users/ALM/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/ALM/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

hollubaun commented 2 years ago

Hi! I keep getting the same error, did you find a solution to this?

GeoPontes commented 2 years ago

Hi! I keep getting the same error, did you find a solution to this?

I managed to solve it by simplifying the vector layer that i was using to crop the raster layer in QGIS2ThreeJS.

QGIS can perform this vector layer simplification in: Vector -> Geometry -> Simplify (you should test configurations that are suited for your vector layer, but is easir to oversimplify and calibrate from it).

Best of luck!