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
Copy file name to clipboardExpand all lines: Sources/GISTools/Algorithms/LineOverlap.swift
+12-10
Original file line number
Diff line number
Diff line change
@@ -103,24 +103,25 @@ extension GeoJson {
103
103
104
104
/// Returns the overlapping segments with the receiver itself.
105
105
///
106
-
/// This implementation is streamlined for finding self-overlaps.
106
+
/// This implementation has been optimized for finding self-overlaps.
107
107
///
108
108
/// - Note: Altitude values will be ignored.
109
109
///
110
110
/// - Parameters:
111
-
/// - tolerance: The tolerance, in meters. Choosing this too small might lead to memory explosion.
112
-
/// Using `0.0` will only return segments that *exactly* overlap.
111
+
/// - tolerance: The tolerance, in meters. Using `0.0` will only return segments that *exactly* overlap.
112
+
/// - segmentLength: This value adds intermediate points to the geometry for improved matching, in meters. Choosing this too small might lead to memory explosion.
113
113
///
114
114
/// - Returns: All segments that at least overlap with one other segment. Each segment will
/// An estimate of how much the receiver overlaps with itself.
217
218
///
218
219
/// - Parameters:
219
-
/// - tolerance: The tolerance, in meters. Choosing this too small might lead to memory explosion.
220
-
/// Using `0.0` will only use segments that *exactly* overlap.
220
+
/// - tolerance: The tolerance, in meters. Using `0.0` will only count segments that *exactly* overlap.
221
+
/// - segmentLength: This value adds intermediate points to the geometry for improved matching, in meters. Choosing this too small might lead to memory explosion.
221
222
///
222
223
/// - Returns: The length of all segments that overlap within `tolerance`.
223
224
publicfunc estimatedOverlap(
224
-
tolerance:CLLocationDistance
225
+
tolerance:CLLocationDistance,
226
+
segmentLength:Double?=nil
225
227
)->Double{
226
-
guardlet result =overlappingSegments(tolerance: tolerance)else{return0.0}
228
+
guardlet result =overlappingSegments(tolerance: tolerance, segmentLength: segmentLength)else{return0.0}
0 commit comments