Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        //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);
        }
Ejemplo n.º 3
0
        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
            });
        }