mapbox/turf-swift

Add LineString intersection method

1ec5 opened this issue · 0 comments

1ec5 commented

intersection(_:_:) takes two instances of LineSegment, which is just a type alias for a tuple of two coordinates. This is an unusual type used nowhere else in the library. I think it’s intended to be more efficient than LineString for intersection purposes, but LineString would be more discoverable. We should add a LineString.intersection(with:) method that takes another LineString. This method would be more discoverable and intuitive than the existing intersection(_:_:) method, and we might eventually have an opportunity to make it more generic as part of a protocol once #51 is implemented.

/cc @mapbox/navigation-ios @ZiZasaurus