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.
Hi,
Hi have a quality mesh that I wish to Z interpolate using a raster (DEM).
When doing so I got this error:
FormatError: Zero index encountered in non-zero-indexed file, C:/Users/joaop/Drive IST/PhD/MAPUTO/SIG/MESH/Modelacao_MAPUTO_quality-mesh.2dm, 3
Traceback (most recent call last):
File "C:\Users/joaop/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\plugin\gui\worker.py", line 90, in run
value = self.target(self.feedback, *self.args, **self.kwargs)
File "C:\Users/joaop/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\plugin\gui\interpol.py", line 216, in worker
interpol_mesh = Mesh.open(target_layer.source())
File "C:\Users/joaop/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\basemesh\core\mesh.py", line 310, in open
with py2dm.Reader(filename) as reader:
File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_read.py", line 72, in __enter__
self.open()
File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_read.py", line 432, in open
super().open()
File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_read.py", line 279, in open
*scan_metadata(file_, self._filepath, self._zero_index))
File "C:\Users\joaop\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\basemesh\packages\py2dm-0.2.1-py3-none-any.whl\py2dm\_parser\_pyparser.py", line 183, in scan_metadata
raise FormatError(
py2dm.errors.FormatError: ('Zero index encountered in non-zero-indexed file', 'C:/Users/joaop/Drive IST/PhD/MAPUTO/SIG/MESH/Modelacao_MAPUTO_quality-mesh.2dm', 3)
Any help on this?!
Thanks
João Barreiro
Environmental Engineer (MSc) - PhD Student
Offline
Ok, I solved this problem by changing the directory of the quality mesh to one withouth empty spaces.
Now I got the OSError: 22, Invalid argument. I know this is a known issue... Will the fix get out soon?
João Barreiro
Environmental Engineer (MSc) - PhD Student
Offline
I still encounter this issue even when using a short, no-space path: 'Zero index encountered in non-zero-indexed file'
The error from py2dm refers to the quality mesh 2dm file. I can see that recently generated quality meshes all start with the first node numbered as 0, whereas older 2dm files (from last year or so) start with the first node numbered as 1.
This is a snippet from a recently generated 2dm file:
MESH2D
NUM_MATERIALS_PER_ELEM 0
ND 0 2.604613e+06 1.190787e+06 0.000000e+00
ND 1 2.604693e+06 1.190490e+06 0.000000e+00
ND 2 2.604504e+06 1.190497e+06 0.000000e+00
Best regards,
Martin
Offline