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
0.5.0 to 1.2.0 versions are not giving me right values for LineString.closestCoordinate(to:) function.
My project's current version is 0.3.0 and was able to calculate re-route when the distance between the current location and the current step's polyline is more than 100 or 200 meters.
I have upgraded to 1.2.0 and I am not able to request for rerouting since closestCoordinate function is not returning proper value. Even 0.5.0 also not returning me proper values (IndexedCoordinate).
But I am able to get proper values if I use 0.4.0 version.
Previously I were using Polyline(coordinates) to create a polyline, But after upgrading to 0.4.0 or higher version, I have used LineString(coordinates) to create the polyline which can be used to get the closestCoordinate (IndexedCoordinate). This IndexedCoordinate always showing a distance of either 46.7*** or -1.*** even though I had travelled for more than 50km.
I have the same issue, and I'm surprised nobody has answered this point ...
In turf.js, nearestPointOnLine returns 4 elements:
closest point on the line to point
index : closest point was found on nth line part
dist : distance between pt and the closest point
location : distance along the line between start and the closest point.
In previous releases, turf-swift was returning 3 elements:
closest point on the line to point (CLLocationCoordinate2D)
index : closest point was found on nth line part (Int)
dist : distance between pt and the closest point (CLLocationDistance)
In the latest release, it is returned 3 elements as well, but the distance is no more the same data. It was the distance between pt and the closest point, it is now distance along the line between start and the closest point.
From my point of view, the 4 elements are important, and you should add a property to IndexedCoordinate to return a piece of information aligned with turf.js
0.5.0 to 1.2.0 versions are not giving me right values for LineString.closestCoordinate(to:) function.
My project's current version is 0.3.0 and was able to calculate re-route when the distance between the current location and the current step's polyline is more than 100 or 200 meters.
I have upgraded to 1.2.0 and I am not able to request for rerouting since closestCoordinate function is not returning proper value. Even 0.5.0 also not returning me proper values (IndexedCoordinate).
But I am able to get proper values if I use 0.4.0 version.
Previously I were using Polyline(coordinates) to create a polyline, But after upgrading to 0.4.0 or higher version, I have used LineString(coordinates) to create the polyline which can be used to get the closestCoordinate (IndexedCoordinate). This IndexedCoordinate always showing a distance of either 46.7*** or -1.*** even though I had travelled for more than 50km.
github "mapbox/turf-swift" ~> 1.2
github "mapbox/turf-swift" == 1.2.0
I have added the library using the above two ways in my cartfile.
Please guide me to resolve my issue.
The text was updated successfully, but these errors were encountered: