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 }); }
private static void PrintFilteredLocations() { var filter = new GpsTrackFilter(); var track = filter.Filter(Examples.Locations); PrintPoints(track); }
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); }
public TrackService() { var filter = new GpsTrackFilter(); DefaultFilterOptions = new GpsTrackFilterOptions { ModelPrecision = filter.ModelPrecision, OutlineSpeed = filter.OutlineSpeed, SensorPrecision = filter.SensorPrecision, ZeroSpeedDrift = filter.ZeroSpeedDrift }; }