Repository navigation
In JTSTriangulator, use DelaunayTriangulationBuilder instead of ConformingDelaunayTriangulator - #3128
Conversation
|
Thanks! Did you test if there are any speed differences? And why is
Unfortunately without this it will be harder to accept this PR. |
…rmingDelaunayTriangulator
3b17426 to
aa9af1b
Compare
Fixed, it was not intentional.
The new version seems to be substantially faster. I have an isochrone generation test that generates a 4 hour isochrone from some point in modesto with
I will think about how I can write a good test to reproduce the stability issue. |
|
I wrote a test but it doesn't trigger the triangulation error in master. Unfortunately I don't have more time to dedicate to this PR. Test can be found in this branch: https://github.com/james-willis/graphhopper/tree/triangulator-builder-with-test. I can add to this PR if you would like |
|
What do you mean the test doesn't trigger the triangulation error in master. Does it trigger the error somewhere else? |
I mean the test doesn't test the bug I've fixed with this PR. Fairly worthless. |
|
Ok, but you are saying if we generate lots of isochrones like you explained in locationtech/jts#1121 the error should be triggered? Or is there something special we need to do to reproduce it? |
|
I'm not sure if there is some characteristic of the graph (not OSM derived) I'm generating Isochrones from in that issue report that causes the bug to trigger. So I'm unsure if just generating a lot of isochrones will be sufficient to trigger the bug. I think the test code I wrote could be used if we find a good case to repro with. I might be able to come back to this next week and see if I can fit the case from the issue above into the unit test in the linked branch. |
|
Ok thanks. If you can come up with any instructions how to reproduce the error I can help extracting a unit test from it. |
There was a problem hiding this comment.
Extremely good catch, many thanks!
Background: I ultimately do want to use ConformingDelaunayTriangulator, because I want to set the entire road network as constraints. Because that works, and it solves some problems that still exist. I verified that with a different, non-Java, implementation. However, I couldn't do that with this class, because I ran into issues with stability and performance.
What I missed was that some issues are still there if I don't set any constraints. Apparently I just took for granted that the class would behave the same as the regular one if the constraint set is empty.
If your feedback to Dr. JTS now means that someday we will be able to actually do the constrained triangulation, I will be up in the clouds.
|
I mean... |
|
There is also Maybe not. By analogy, it might finally work if we use it. |
Yeah Dr JTS recommended this until he noticed we had no constraints. |
This PR is based on this discussion with Martin (Dr. JTS): locationtech/jts#1121
He suggested that DelaunayTriangulationBuilder is likely the most appropriate way to build this triangulation.
i'm unsure if there are other simplifications that can be made to this class based on the changes in this PR.
I apologize for failing to add a new test, I am struggling to build a test case that captures the bug in the JTS issue above.