-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polyfile parser does not parse 2D boundary type of pli file correctly. #467
Comments
Hi @xldeltares, minor comment,
If you got your code from some documentation, please let me/@arthurvd know so it can be updated. If you use this code in the next release of hydrolib-core, you will get an error, so it is at least clear that the polyfile is not being read.
|
Thanks, @arthurvd and @veenstrajelmer for the explanation! Now I understand why the supported point labels are not supported by hydrolib-core. And I agree that the fix should first be the front- and back-end. Since the pli file without supported point labels can indeed be read back to the GUI, I think we are good off with reading/writing pli files without supported point labels in hydromt-delft3dfm. |
Thanks! I did not get the code from the documentation, it was a small test of "Why my PolyFile object is empty" :) |
Hi @xldeltares, I will re-open this issue, because I think hydrolib-core should support reading of boundary polylines currently produced by the FM Suite (both kernel and GUI support reading of pli point labels, only they are not used in the actual calculation). |
Hi @xldeltares, I know that you are currently modifying boundary pli files, removing the last column with point labels. |
@arthurvd, I see @xldeltares is out of office and I had a testcase ready so I tested it. Reading a polyfile with labels now works and is correctly parsed. |
@veenstrajelmer Thanks for picking this up! |
Describe the bug
Polyfile parser does not parse 2D boundary type of pli file correctly.
See example file: Boundary01.pli.txt
To Reproduce
Steps to reproduce the behavior:
See the empty
objects
, while the 'Boundary01.pli' is not empty:"
Boundary01
3 2
6.625216613133794E+005 1.524474171041823E+006 Boundary01_0001
6.625216613133794E+005 1.524910832891534E+006 Boundary01_0002
6.625216613133794E+005 1.525410832891534E+006 Boundary01_0003
"
Expected behavior
Able to parse this file for the 2D boundary.
Suggested solution
(by @arthurvd )
The third column of support point labels should be ignored by the parser (but NOT lead to an error). The header definition is leading: if it specifies 2 columns, then only read 2 values from each line, and silently ignore anything that's left at the end.
My motivation for this solution is: the Delft3D FM Suite currently exports with a support point label on each line, and we want to support all models files produced by our official release.
However, there is no need to parse and store those labels, because they are in fact ignored right now by the kernel, because frontend and backend are not using the same format currently (even though they are present in the .pli files)
This first need to be fixed in frontend+backend. Only then we will consider full support in hydrolib-core.
Version info (please complete the following information):
The text was updated successfully, but these errors were encountered: