You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DouglasPeuckerLineSimplifier.simplifySection() recursive calls cause StackOverflowError #1127
Recently had a lineString that was very very noisy. Junk in junk out, I get it.
However, I think maybe the simplifySection() method could add some protection against extreme recursive calls that cause the machine error StackOverflowError.
Good idea. Can you share the data that caused the stack overflow?
Unfortunately no. It is proprietary data... blah, blah. It was essentially coordinates from multiple platforms running in separate countries that were combined into one array of data ( unreliable data provider ). Routes lasting approx. 6 hours with a location every 3-6 seconds.
Then end result was a line that ping ponged back and forth spanning multiple countries.
Using a tolerance of only .4 nautical miles, I am assuming the simplification algorithm attempted to sub-divide the line string down to segments of 1-3 points each just and just ran out of stack before it could achieve that.
To see the line drawn on a map it appeared as a solid geometry ( at lower resolutions ) resembling a small continent :)
Activity
dr-jts commentedon May 1, 2025
Good idea. Can you share the data that caused the stack overflow?
dr-jts commentedon May 1, 2025
Another option is to switch to using an explicit stack instead of recursion.
garneke commentedon May 2, 2025
Unfortunately no. It is proprietary data... blah, blah. It was essentially coordinates from multiple platforms running in separate countries that were combined into one array of data ( unreliable data provider ). Routes lasting approx. 6 hours with a location every 3-6 seconds.
Then end result was a line that ping ponged back and forth spanning multiple countries.
Using a tolerance of only .4 nautical miles, I am assuming the simplification algorithm attempted to sub-divide the line string down to segments of 1-3 points each just and just ran out of stack before it could achieve that.
To see the line drawn on a map it appeared as a solid geometry ( at lower resolutions ) resembling a small continent :)