CHLNDDEV / OceanMesh2D

A two-dimensional triangular mesh generator with pre- and post-processing utilities written in pure MATLAB (no toolboxes required) designed specifically to build models that solve shallow-water equations or wave equations in a coastal environment (ADCIRC, FVCOM, WaveWatch3, SWAN, SCHISM, Telemac, etc.).
https://github.com/sponsors/krober10nd
GNU General Public License v3.0
178 stars 64 forks source link

Add empty cell filter into Read_shapefile.m #315

Closed alexander0042 closed 1 month ago

alexander0042 commented 1 month ago

When shapefiles are edited in QGIS, empty indexes can sometimes be created, which crashes the script. This line adds a check to see if there are any empty cells and removes them.

krober10nd commented 1 month ago

Thanks, Alexander! Maybe also add a warning message to be output to the screen too?

krober10nd commented 1 month ago

Please also add the change to the changelog.

alexander0042 commented 1 month ago

Thanks for the quick reply! Added in a warning if applicable and edited the changelog to explain the change. I don't think this is a super common edge case, but it can definitely happen when shapefiles are modified in QGIS, so probably worth having the handling code.