Skip to content

Upgrade sweepline-intersections#3070

Draft
mfedderly wants to merge 3 commits into
masterfrom
mf/upgrade-sweepline-intersections
Draft

Upgrade sweepline-intersections#3070
mfedderly wants to merge 3 commits into
masterfrom
mf/upgrade-sweepline-intersections

Conversation

@mfedderly

@mfedderly mfedderly commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Upgrades sweepline-intersections to pick up fixes for arethetypeswrong. There is also a change rowanwins/sweepline-intersections@e7a48be where it adds detection for endpoint intersections which previously did not exist.

Breaking:

This changes the behavior of @turf/boolean-crosses from returning true to false when the line/line intersection is on an end point. I think this matches the DE9IM intended behavior now. This might be worth just flagging as a breaking behavior change to be safe, so I'll put it in v8.

Todo:

Note: tinyqueue@3 (released nearly 2 years ago) breaks node@18 compatibility. So that's another point towards only including this in turf@8.

mfedderly added 2 commits May 28, 2026 08:44
…rtex

Upgrading sweepline-intersections in line-intersect started to cause failures in boolean-crosses. It looks like rowanwins/sweepline-intersections@e7a48be added endpoint intersection detection.

When trying to grapple with this back in boolean-crosses, I noticed that the booleanEqual first parameter was a geometry but the second was a feature which was causing it to return false even when the [1, 1] point was used in the coordinate arrays of both.

After fixing the doLineStringsCross method, it fixed the test that had been marked as false, but now the true test is failing. From spot-checking against PostGIS I think we're actually supposed to return false if two linestrings only cross at an end point.

postgres=# SELECT ST_Crosses(
postgres(#     'LINESTRING(-2 1, 4 1)'::geometry,
postgres(#     'LINESTRING(1 1, 1 2, 1 3, 1 4)'::geometry
postgres(# );
 st_crosses
------------
 f
(1 row)

postgres=# SELECT ST_Crosses(
    'LINESTRING(-2 2, 1 1)'::geometry,
    'LINESTRING(1 1, 1 2, 1 3, 1 4)'::geometry
);
 st_crosses
------------
 f
(1 row)
@mfedderly mfedderly added this to the v8 milestone May 28, 2026
@mfedderly mfedderly mentioned this pull request May 28, 2026
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.

1 participant