public IDictionary <string, DateTime> Dates() { var dates = new Dictionary <string, DateTime> { { "startDate", Stops.Any() ? Stops.Select(s => s.Arrival.Date).Min() : new DateTime() }, { "endDate", Stops.Any() ? Stops.Select(s => s.Departure.Date).Max() : new DateTime() } }; return(dates); }
//TODO: Add new fetures: 1. Year of Trip (start) 2. TripStart and End Date 3. Number of days public IDictionary <string, int> Statistics() { var statistics = new Dictionary <string, int> { { "countriesCount", Countries().Count() }, { "stopsCount", Stops.Count() }, { "userCount", Users().Count() }, { "worldHeritages", WorldHeritages().Count() }, { "yearOfTrip", Stops.Select(s => s.Arrival.Year).Max() }, { "numberOfDays", System.Convert.ToInt32(System.Math.Floor((Stops.Select(s => s.Departure).Max() - Stops.Select(s => s.Arrival).Min()).TotalDays)) } }; return(statistics); }
public MemoryLayer CreateStopLayer() { var _stopEnumerator = Stops.GetEnumerator(); _stopEnumerator.MoveNext(); return(new MemoryLayer { //Todo: Have each stop have it's own style //Todo: Not have application fail when Stops is empty Name = "Locations", DataSource = new MemoryProvider(Stops.Select(i => i.Feature)), Style = _stopEnumerator.Current.Icon }); }