I have a mobile application built in .NET MAUI that has a hike tracking feature. Basically, the goal is to show the traversed path as a polyline on the map. This is the basic code I'm using to perform the calculation and do tracking using Maps SDK
MapPoint mp = e.Position; // e = Esri.ArcGISRuntime.Location.Location from location changed event
mp = (MapPoint)GeometryEngine.Project(e.Position, SpatialReferences.WebMercator);
polylineBuilder.AddPoint(mp);
trackedHikePolylineGraphicsOverlay.Graphics.Add(new Graphic(polylineBuilder.ToGeometry()));
I'm essentially adding the user's current location from the location changed event to the polyline builder and updating the graphics overlay. Nothing complicated.
My problem is that when this is tested in the field, I end up with wildly zigzagging polylines because location gets miscalculated at times by the GPS. How do ESRI apps and even apps like Strava track breadcrumb path and show that on a map without erratic lines? I realize it is not a hardware problem, because other tracking apps on the same device can record a reasonably well polyline for the same activity.
Thanks!
Hi,
You can use DGPS (Differential GPS) to improve your accuracy. I think, you could simplify your GPS data as suggested here. ArcGIS geoprocessing tool Simplify Line can help you, but it needs standard or advanced license. Ramer-Douglas-Peucker line simplification code you can find by web search or click on link.