BASEMENTBasic Simulation Environment for computation of environmental flow and natural hazard simulationLaboratory of Hydraulics, Hydrology and Glaciology (VAW)ETH Zurich |
You are not logged in.
Pages: 1
Hi,
I work with QGIS 3.16.7 and Basemesh 1.4.5. After asking for "Renumber Mesh", I had received the following answer :
"TypeError: MultiPolygon geometry cannot be converted to a polygon. Only single polygon or curve polygon types are permitted.
Traceback (most recent call last):
File "C:/Users/steph/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BASEmesh\gui\widgets.py", line 1653, in accept
result = nodeManipulation.renumber(nodesLayer, elevationField, elementsLayer, materialField, 10**precisionExp, self.progressBar)
File "C:/Users/steph/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\BASEmesh\tools\nodeManipulation.py", line 222, in renumber
ring = featCell.geometry().asPolygon()[0]
TypeError: MultiPolygon geometry cannot be converted to a polygon. Only single polygon or curve polygon types are permitted.
Version de Python : 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
Version de QGIS : 3.16.7-Hannover Hannover, 0471743889
Chemin Python :
C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python
C:/Users/steph/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/steph/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.16/apps/qgis-ltr/./python/plugins
C:\PROGRA~1\QGIS3~1.16\apps\Python37
C:\PROGRA~1\QGIS3~1.16\apps\Python37\Scripts
C:\Program Files\QGIS 3.16\bin\python37.zip
C:\PROGRA~1\QGIS3~1.16\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib
C:\Program Files\QGIS 3.16\bin
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.16\apps\Python37\lib\site-packages\Pythonwin
C:/Users/steph/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/steph/Desktop/1546-Rive-Droite/Test".
But it seems that I can only create MultiPolygon shape on QGIS, but no single polygon.
Do you know how to solve this, please ?
Thanks in advance.
Offline
I moved the topic since it concerns BASEmesh.
It has been a while since I last used basemesh 1.4.5, but you might try and create a new layer which is a single polygon, copy paste all the elements to it and try and renumber. I have no idea if this would work.
What are you trying to achieve by renumbering the mesh? (I am asking because maybe there's another way to solve your problem!)
Offline
Hi,
Thanks again for your help. Il will try your solution (but it seems that all Polygon shape created is in the Multipolygon mode), as well as your proposal to update Basement for the 2 version.
For replying your question, I need to renumber my mesh, after having change the topography of a project site.
Best regards. Stéphanie.
Offline
Hi Stéphanie,
Try the "Multipart to singleparts" algorithm of the "Vector geometry" section in the QGIS processing toolbox. It should break the MultiPolygon geometry up into individual Polygon features, which should work with the v1.4.5 converter.
Best,
Leonhard
Offline
Pages: 1