Example #1
0
        private ITrackSegment SimplifySegment(ITrackSegment segment)
        {
            GeoFramework.Position prevPosition      = new Position();
            List <IWayPoint>      wayPointsToRemove = new List <IWayPoint>();

            foreach (IWayPoint wayPoint in segment.SegmentWaypoints)
            {
                Position position = new Position(wayPoint.Latitude.ToString(), wayPoint.Longitude.ToString());

                if (position.DistanceTo(prevPosition) < _SimplifyingDistance)
                {
                    wayPointsToRemove.Add(wayPoint);
                }
                else
                {
                    prevPosition = position;
                }
            }

            foreach (IWayPoint wayPoint in wayPointsToRemove)
            {
                segment.SegmentWaypoints.Remove(wayPoint);
            }
            return(segment);
        }
Example #2
0
        private ITrackSegment SimplifySegment(ITrackSegment segment)
        {
            GeoFramework.Position prevPosition = new Position();
            List<IWayPoint> wayPointsToRemove = new List<IWayPoint>();
            foreach (IWayPoint wayPoint in segment.SegmentWaypoints)
            {
                Position position = new Position(wayPoint.Latitude.ToString(), wayPoint.Longitude.ToString());

                if (position.DistanceTo(prevPosition) < _SimplifyingDistance)
                {
                    wayPointsToRemove.Add(wayPoint);

                }
                else
                {
                    prevPosition = position;
                }
                
            }

            foreach (IWayPoint wayPoint in wayPointsToRemove)
            {
                segment.SegmentWaypoints.Remove(wayPoint);
            }
            return segment;

        }
Example #3
0
        private List <GMap.NET.PointLatLng> ConvertTrackSegment(ITrackSegment segment)
        {
            List <GMap.NET.PointLatLng> points = new List <GMap.NET.PointLatLng>(segment.SegmentWaypoints.Count);

            for (int i = 0; i < segment.SegmentWaypoints.Count; i++)
            {
                GMap.NET.PointLatLng point = new GMap.NET.PointLatLng();
                point.Lat = (double)segment.SegmentWaypoints[i].Latitude;
                point.Lng = (double)segment.SegmentWaypoints[i].Longitude;

                points.Add(point);
            }
            return(points);
        }
        private List<GMap.NET.PointLatLng> ConvertTrackSegment(ITrackSegment segment)
        {
            List<GMap.NET.PointLatLng> points = new List<GMap.NET.PointLatLng>(segment.SegmentWaypoints.Count);

            for (int i = 0; i < segment.SegmentWaypoints.Count; i++)
            {
                GMap.NET.PointLatLng point = new GMap.NET.PointLatLng();
                point.Lat = (double)segment.SegmentWaypoints[i].Latitude;
                point.Lng = (double)segment.SegmentWaypoints[i].Longitude;

                points.Add(point);
            }
            return points;
        }