qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.52k stars 2.99k forks source link

Material ID support for 2DM meshes #36579

Closed leonhard-s closed 4 years ago

leonhard-s commented 4 years ago

Feature description.

There is currently no way to easily visualise Material IDs when working with 2DN meshes.

Considering that MATIDs are part of the 2DM format, I believe it would be nice to be able to natively visualise them like any other dataset.

Additional context

I was able to hack in visualisation by adding the MATID column to the mesh a second time, at which point QGIS treats the IDs as "Bed Elevation (Face)" and visualizes it as expected (see screenshots below).

imageExcerpt from a 2DM mesh with hacky second MATID column

imageThe same mesh with MATIDs visualised via secondary MATID

This of course only works if the mesh itself does not make use of the element elevation column itself, any more tokens will cause all of the extra columns to be ignored.

Is there a reason the "official" 2DM MATIDs are ignored by default?

If compatibility with the element elevation column is an issue, I'd argue that it makes more sense to support the 2DM-native MATIDs and move the non-standard element elevations into an auxiliary data source.

saberraz commented 4 years ago

Hi @leonhard-s In old crayfish plugin we had some basic labelling of mesh data. We have already thought about adding a more generic labelling (similar to the one in for vectors) to handle mesh layers.

Feel free to contact us, if you'd be interested in supporting this effort.

leonhard-s commented 4 years ago

Thank you for your reply. I agree that a generic labelling system for element or node IDs would be a useful addition, especially for double-checking node strings or when trying to track down misbehaving elements by ID.

But I think there might be an easier solution for 2DM MATIDs; namely supporting as many MATIDs as the 2DM promises in its NUM_MATERIALS_PER_ELEM card, and handling them in the exact same way as is done for BASEMENT 3.x in line 199f of mdal_2dm.cpp.

I might have a play-around with that next week - or am I overlooking anything here?

saberraz commented 4 years ago

The labelling has to be generic to handle other types of elements too. Currently, mesh can be 1d, 2D and 2.5D (stacked 2d mesh). So, for example, with a generic labelling engine, you should be able to label 1D elements (e.g pipes and manholes), 2D cell-centres, 2D edges and nodes....

leonhard-s commented 4 years ago

Certainly, and I understand that this engine is a bigger effort that is not easily patched in. But what I meant to suggest is not so much labelling as it is symbology.

Labelling elements with "1", "2", "3", etc. based on their MATID would require labelling. But for material indices, colouring the elements accordingly (like in the screenshot above) is much more useful to the user.

Unless the labelling system would also cover generic versions of these symbology rules, I don't think this addition is redundant.

PeterPetrik commented 4 years ago

I suggest to continue discussion in https://github.com/lutraconsulting/MDAL/issues/259, since if I understand it correctly and we go the way be parsing material ID with MDAL and adding it as a new dataset group, it will not require any changes on QGIS side.