Ejemplo n.º 1
0
        public Tracks FromRaw(IReadOnlyList <IndexedLocation> indexedLocations, GpsTrackFilterOptions filterOptions)
        {
            var rawGeoJson = indexedLocations.ToGeoJson();
            var rawSummary = indexedLocations.ToTrackSummary();

            var directedLocations = indexedLocations.FixGpsTimestamp()
                                    .SmoothTimestamp()
                                    .ToDirectedLocations();

            var filter = new GpsTrackFilter
            {
                ModelPrecision  = filterOptions.ModelPrecision,
                OutlineSpeed    = filterOptions.OutlineSpeed,
                SensorPrecision = filterOptions.SensorPrecision,
                ZeroSpeedDrift  = filterOptions.ZeroSpeedDrift
            };

            var filteredLocations = filter.Filter(directedLocations).ToDeviceLocations();
            var filteredSummary   = filteredLocations.ToTrackSummary();
            var filteredGeoJson   = filteredLocations.ToGeoJson();

            return(new Tracks
            {
                Raw = rawGeoJson,
                RawSummary = rawSummary,
                Filtered = filteredGeoJson,
                FilteredSummary = filteredSummary
            });
        }
Ejemplo n.º 2
0
        private static void PrintFilteredLocations()
        {
            var filter = new GpsTrackFilter();
            var track  = filter.Filter(Examples.Locations);

            PrintPoints(track);
        }
Ejemplo n.º 3
0
        private static void PrintFilteredDirections()
        {
            var filter = new GpsTrackFilter();
            var track  = filter.Filter(Examples.Directions)
                         .Select(x => new Location(x.Latitude, x.Longitude, x.Timestamp));;

            PrintPoints(track);
        }