Skip to content

Changed lineSplit to use bbox from geojson-rbush rather than buggy turf-square#2460

Merged
smallsaucepan merged 12 commits intoTurfjs:masterfrom
hanneshdc:issue-1232
May 25, 2025
Merged

Changed lineSplit to use bbox from geojson-rbush rather than buggy turf-square#2460
smallsaucepan merged 12 commits intoTurfjs:masterfrom
hanneshdc:issue-1232

Conversation

@hanneshdc
Copy link

@hanneshdc hanneshdc commented Jul 21, 2023

This PR fixes #1232.
Resolves #2288

The cause of the issue is the application of turf-square to feature bounding boxes, which sometimes incorrectly results in a smaller bounding box. While this is really a bug in turf-square, the application isn't needed here. Instead, we can remove the bbox calculation completely and allow geojson-rbush to calculate it for us instead.

From the template:

  • [ x ] Use a meaningful title for the pull request. Include the name of the package modified.
  • [ x ] Have read How To Contribute.
  • [ x ] Run npm test at the sub modules where changes have occurred.
  • [ x ] Run npm run lint to ensure code style at the turf module level.

Submitting a new TurfJS Module. (N/A)

@hanneshdc hanneshdc changed the title Fix Issue 1232 - Bug in turf-line-split Fix Issue #1232 - Bug in turf-line-split Jul 21, 2023
@mfedderly
Copy link
Collaborator

I'd like to merge this. Any chance you have time to clean up the merge conflicts first?

@kudlav
Copy link
Contributor

kudlav commented Nov 21, 2024

Hi, what's the reason for closing this PR? Was is solved in another PR?

@hanneshdc hanneshdc reopened this Nov 24, 2024
@hanneshdc
Copy link
Author

@kudlav not sure what happened! GitHub seems to have automatically closed it when I rebased the branch.

Have re-opened.

@smallsaucepan smallsaucepan changed the title Fix Issue #1232 - Bug in turf-line-split Changed lineSplit to use bbox from geojson-rbush rather than buggy turf-square May 24, 2025
…ntioned in issue Turfjs#1232, as well as Turfjs#2288 which this PR also helps address. Tidied up some test file Typescript errors.
@smallsaucepan smallsaucepan self-requested a review May 24, 2025 14:03
@smallsaucepan
Copy link
Member

Thanks for doing this @hanneshdc. Sorry it took so long to merge.

@smallsaucepan smallsaucepan merged commit 05494d8 into Turfjs:master May 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lineSplit doesn't detect all intersections with curved lines lineSplit doesn't split correctly

4 participants