minorua / Qgis2threejs

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

error and crash #298

Open Shemesh opened 1 year ago

Shemesh commented 1 year ago

hi, while trying to render a polygon layer the plugin crash with this error. what does it mean?

WARNING Traceback (most recent call last): File "C:\Users/ooo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 330, in _processRequests self.buildLayer(item) File "C:\Users/ooo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 236, in buildLayer ret = self._buildLayer(layer) File "C:\Users/ooo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\q3dcontroller.py", line 275, in _buildLayer obj = builder.build() File "C:\Users/ooo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\buildvector.py", line 424, in build d["geom"] = obj_geom_func(f, f.geometry(self.z_func, mapTo3d, self.useZM, be, self.grid)) File "C:\Users/ooo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\buildvector.py", line 70, in geometry return TINGeometry.fromQgsGeometry(self.geom, zf, transform_func, File "C:\Users/ooo/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\Qgis2threejs\geometry.py", line 397, in fromQgsGeometry pt = geometry.centroid().asPoint() ValueError: Null geometry cannot be converted to a point.

Shemesh commented 1 year ago

I've narrowed my kml down to the problematic point. p.s. using plugin "KML Tools" to import because native qgis don't know to import polygons. here is my kml: what is wrong with it?

`<?xml version="1.0" encoding="UTF-8"?>

kkk absolute 35.541556,32.776548,-1.392 35.541556,32.776548,-1.392 35.541556,32.776548,-1.392

`

Shemesh commented 1 year ago

taking a deeper look at the kml (above) seems like the coordinates are all the same. which actually means nothing. @minorua - in such case can the plugin ignore it? (rather than crashing)

minorua commented 5 months ago

Thanks for your bug report.