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
turf.lineSplit is not splitting properly large geometries, even after removing the square as suggested in #1232.
I have two cases. The first is on a scale of 1:100, and the second is 1:1 (original). For the first one, it returns 5 segments (correct), for the second one only 4 of 5 segments.
This code doesn't check if the closestLine was actually split into two lines. And, in my second case, when splitLineWithPoint splitting using point [771.0658597785978, 2882.976740278172], the splitLineWithPoint returns only one line instead of twos (the splitting or choosing the closestLine is broken).
Thanks for the detailed write up @kudlav. For the second example (which returns an incorrect result) I noticed the co-ordinates are outside what would typically be expected as valid geojson for Turf:
[lng, lat] respectively would typically be -180 to +180, and -90 to +90 decimal degrees. Can you run through your use case in more depth if those are the values you need to use? What is the significance of the scaling?
Hi, you are right. I'm working out of WGS84 range. Other turf functions are fine with it. I'll normalize our range into WGS84 before using the splitLineWithPoints as a workaround.
turf.lineSplit
is not splitting properly large geometries, even after removing the square as suggested in #1232.I have two cases. The first is on a scale of 1:100, and the second is 1:1 (original). For the first one, it returns 5 segments (correct), for the second one only 4 of 5 segments.
The problem is in
splitLineWithPoints
function.It gets correctly the same 4 intersections, the splitter parameter is:
This code doesn't check if the
closestLine
was actually split into two lines. And, in my second case, whensplitLineWithPoint
splitting using point[771.0658597785978, 2882.976740278172]
, thesplitLineWithPoint
returns only one line instead of twos (the splitting or choosing theclosestLine
is broken).turf/packages/turf-line-split/index.js
Lines 105 to 109 in c76e6e9
@turf/turf v7.0.0-alpha.115
Node.js v20.11.1
The text was updated successfully, but these errors were encountered: