josm icon indicating copy to clipboard operation
josm copied to clipboard

JOSM #21881 - Add a check for loops in directional waterways

Open gabortim opened this issue 2 years ago • 5 comments

See https://josm.openstreetmap.de/ticket/21881

The code is tested and ready to review, only the Tarjan class needs to be moved around because I intended it a generally usable utility class.

gabortim avatar Oct 08 '23 11:10 gabortim

Thanks, I forgot to run pmd and checkstyle. It should be fixed now.

What about the folder naming algos? I plan to move "general" algorithms to this folder in the future to have a common place and reduce possible duplications.

gabortim avatar Dec 18 '23 22:12 gabortim

As a general rule of thumb, I would avoid shortening names. algos is fairly self-explanatory to native English speakers, but algorithms is probably better.

tsmock avatar Dec 19 '23 11:12 tsmock

I fixed all the findings, checkstyle and pmd pass now. Testsuite is running.

One thing remains in my head, if the data.validator is a good place for the new algorithms package. It may be better placed one level up, under data. What do you think?

gabortim avatar Dec 20 '23 14:12 gabortim

It depends upon how widespread the algorithm usage could be. I'd probably put it in data.

tsmock avatar Dec 27 '23 19:12 tsmock

Done in 53b386d.

gabortim avatar Dec 27 '23 19:12 gabortim

In 19062/josm: fix #21881: Add a check for loops in directional waterways Patch by gaben, slightly modified

  • implements Tarjan algorithm to find strongly connected components
  • new preference validator.CycleDetector.directionalWaterways contains the list of waterway values which should be checked

gabortim avatar Apr 27 '24 08:04 gabortim