Fix projected line strings getting truncated early. #1146
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rationale
Essentially, #1131 is another case of an infinite loop like #325. The fix from #567 was to stop splitting after "too many" lines were created. However, it was applied to the entire line string, which meant the entire path could get truncated. Instead, make the limit apply to each segment individually.
Since each segment is somewhat smaller, drop the limit a bit to compensate for having to go through more segments. This keeps things running in a reasonable time. (The test case added here would be ~4 times slower with the old limit.)
Implications
In #1131, this caused a contour on the top-left to be incomplete with the Mollweide projection. Additionally, the contour that grazed the bottom pole disappeared entirely, presumably because the line string started at the bottom and was truncated almost immediately.
Fixes #1131.
Fixes #802.
Fixes #724.
Fixes #1015.