User Forum of Software BASEMENT

BASEMENT
Basic Simulation Environment for computation of environmental flow and natural hazard simulation
Laboratory of Hydraulics, Hydrology and Glaciology (VAW)
ETH Zurich
Basement_Logo

You are not logged in.

#1 2022-03-09 11:46:39

Pérez
User
Registered: 2021-05-17
Posts: 3

Renumber function

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

#2 2022-03-09 11:59:34

Matteo Facchini
Developer
From: Trento
Registered: 2014-09-05
Posts: 278

Re: Renumber function

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

#3 2022-03-09 20:47:24

Pérez
User
Registered: 2021-05-17
Posts: 3

Re: Renumber function

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

#4 2022-09-20 11:35:56

leonhard_s
User
Registered: 2021-06-09
Posts: 10

Re: Renumber function

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

Board footer

Powered by FluxBB